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 {
    init: String!
    cronJob: TotalStats!
    addGroup(groupID: BigInt, groupName: String, groupUsername: String): Groups!
    incrementGroup(groupID: BigInt, linksDeleted: Int): Groups!
    increment(link: Boolean, command: Boolean, trigger: Boolean): 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;
