Added mutations and queries for DaiailyStats and TotalStats. Updated Schema. Added scalar package.

This commit is contained in:
2025-11-11 20:17:14 -05:00
parent ff334a7f0d
commit 834900f9bb
25 changed files with 2483 additions and 4532 deletions

View File

@@ -1,16 +1,41 @@
import { BigIntTypeDefinition } from "graphql-scalars";
const typeDefs = /* GraphQL */ `
${BigIntTypeDefinition}
scalar Date
type Query {
getTotalGroups: Int!
getTodayStats: DailyStats!
getStatsRange(startDate: Date, endDate: Date): [DailyStats]
getTotalStats: TotalStats!
}
type Mutation {
addGroup(groupID: Int, groupName: String): Group!
init: String!
cronJob: TotalStats!
addGroup(groupID: Int, groupName: String): Groups!
increment(link: Boolean, command: Boolean, trigger: Boolean): DailyStats!
}
type Group {
type Groups {
telegramID: Int
name: String
createdAt: Date
updatedAt: Date
}
scalar 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;