sdy

init createAccount

type Mutation {
createAccount(
name: String!
email: String!
bio: String
avatarUrl: String
): User!
}
import { prisma } from "../../../middlewares";
export default {
Mutation: {
createAccount: async (_, args) => {
const { name, email, bio = "", avatarUrl = "" } = args;
const user = await prisma.user.create({
data: {
name,
email,
bio,
avatarUrl,
},
});
return user;
},
},
};