sdy

init createAccount

1 +type Mutation {
2 + createAccount(
3 + name: String!
4 + email: String!
5 + bio: String
6 + avatarUrl: String
7 + ): User!
8 +}
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 +};