close i think on Facebook Auth for prisma, but get...
# prisma-whats-new
m
close i think on Facebook Auth for prisma, but getting this error: Variable "$_where" got invalid value {"facebookUserId":""}; Field "facebookUserId" is not defined by type UserWhereUniqueInput. But don't understand why UserWhereUniqueInput is been triggered, we are creating a user.
n
I believe this is caused by a problem in
graphql-tools
, documented here: https://github.com/graphcool/prisma-binding/issues/73. Workaround is to choose a different name than
where
in your application schema.
🙏 1
m
async function facebookUser(parent, { facebookToken }, context, info) { let user = null try { const facebookUser = await getFacebookUser(facebookToken) user = await context.db.query.user( { where: { facebookUserId: facebookUser.id } }, info, ) if (!user) { user = await createUserFromFacebook(context, facebookUser) } return { token: jwt.sign({ userId: user.id }, APP_SECRET), user, } } catch (error) { throw new Error(error) } }
can i ask sorry what am i changing, cause ive fiddled with this a-bit with no success...
n
could you ask this directly in the issue, so others benefit from it as well? 🙂
m
yes
first time i ever send a issue, so i hope its ok how its posted or hope in correct place
n
yes, thanks!
m
THANK YOU FOR HELPING ME ON A FRIDAY NIGHT....have a great weekend
😂 1
n
thanks, same to you!