import prisma from "@/lib/prismaClient";

//  Prisma
export const resolvers = {
  Query: {
    getTotalGroups: () => prisma.group.count()
  },
  Mutation: {
    addGroup: async (
      _parent: unknown,
      data: { groupID: number; groupName: string }
      // _ctx: unknown
    ) => {
      const { groupID, groupName } = data;
      return await prisma.group.create({
        data: {
          telegramID: groupID,
          name: groupName
        }
      });
    }
  }
};

export default resolvers;
