Showing
2 changed files
with
26 additions
and
0 deletions
1 | +import { prisma } from "../../../middlewares"; | ||
2 | + | ||
3 | +export default { | ||
4 | + Mutation: { | ||
5 | + createAccount: async (_, args) => { | ||
6 | + const { name, email, bio = "", avatarUrl = "" } = args; | ||
7 | + const user = await prisma.user.create({ | ||
8 | + data: { | ||
9 | + name, | ||
10 | + email, | ||
11 | + bio, | ||
12 | + avatarUrl, | ||
13 | + }, | ||
14 | + }); | ||
15 | + return user; | ||
16 | + }, | ||
17 | + }, | ||
18 | +}; |
-
Please register or login to post a comment