Skip to content

Instantly share code, notes, and snippets.

@SilencerWeb
Created June 28, 2018 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SilencerWeb/c27340428ca63793500bec716c5aaefe to your computer and use it in GitHub Desktop.
Save SilencerWeb/c27340428ca63793500bec716c5aaefe to your computer and use it in GitHub Desktop.
signup: async(_, args, context, info) => {
const password = await bcrypt.hash(args.password, 10);
const user = await context.prisma.mutation.createUser({
data: {
email: args.email.toLowerCase(),
password: password,
nickname: args.nickname.toLowerCase(),
name: args.name,
},
});
return {
token: jwt.sign({ userId: user.id }, process.env.APP_SECRET),
user,
};
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment