sdy

create createGroup files

type Mutation {
createGroup(name: String!): Group!
}
import { prisma, isAuthenticated } from "../../../utils";
export default {
Mutation: {
createGroup: async (_, args, { request }) => {
isAuthenticated(request);
const { user } = request;
const { name } = args;
return prisma.group.create({
data: {
name,
creator: user,
},
});
},
},
};