createGroup.js
363 Bytes
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,
},
});
},
},
};