Skip to content

Instantly share code, notes, and snippets.

@SilencerWeb
Last active June 27, 2018 06:10
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/a376b66a519c092e8bdeb8b98dede422 to your computer and use it in GitHub Desktop.
Save SilencerWeb/a376b66a519c092e8bdeb8b98dede422 to your computer and use it in GitHub Desktop.
let user = await context.prisma.query.user(
{
where: {
email: args.login,
},
},
);
if (!user) {
user = await context.prisma.query.user(
{
where: {
nickname: args.login,
},
},
);
if (!user) {
throw new Error(`No such user found`);
}
}
// const user = await context.prisma.query.user(
// {
// where: {
// OR: [
// { email: args.login, },
// { nickname: args.login },
// ],
// },
// },
// );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment