Showing
2 changed files
with
21 additions
and
0 deletions
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 | +}; |
-
Please register or login to post a comment