Last active
June 27, 2018 06:10
-
-
Save SilencerWeb/a376b66a519c092e8bdeb8b98dede422 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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