sdy

create createGroup files

1 +type Mutation {
2 + createGroup(name: String!): Group!
3 +}
1 +import { prisma, isAuthenticated } from "../../../utils";
2 +
3 +export default {
4 + Mutation: {
5 + createGroup: async (_, args, { request }) => {
6 + isAuthenticated(request);
7 + const { user } = request;
8 + const { name } = args;
9 +
10 + return prisma.group.create({
11 + data: {
12 + name,
13 + creator: user,
14 + },
15 + });
16 + },
17 + },
18 +};