Files
no-twitter-bot-stats/src/graphql/types.ts
2025-12-13 15:26:56 -05:00

60 lines
1.3 KiB
TypeScript

import { BigIntTypeDefinition } from "graphql-scalars";
const typeDefs = /* GraphQL */ `
${BigIntTypeDefinition}
scalar Date
type Query {
getTotalGroups: Int!
getTodayStats: DailyStats!
getStatsRange(startDate: String!, endDate: String!): [DailyStats]
getTotalStats: TotalStats!
getGroupStats(groupID: BigInt!): Groups
}
type Mutation {
init(mutationKey: String): String!
cronJob(mutationKey: String): TotalStats!
addGroup(
groupID: BigInt!
groupName: String!
groupUsername: String
mutationKey: String
): Groups!
incrementGroup(
groupID: BigInt!
linksDeleted: Int!
mutationKey: String
): Groups!
increment(
link: Boolean
command: Boolean
trigger: Boolean
mutationKey: String
): DailyStats!
}
type Groups {
telegramID: BigInt
name: String
username: String
linksDeleted: BigInt
createdAt: Date
updatedAt: Date
}
type TotalStats {
createdAt: String
updatedAt: Date
linksDeleted: BigInt
commandResponses: BigInt
timesTriggered: BigInt
}
type DailyStats {
createdAt: String
updatedAt: Date
linksDeleted: Int
commandResponses: Int
timesTriggered: Int
}
`;
export default typeDefs;