Hi, I am using prisma-binding library const userE...
# random
c
Hi, I am using prisma-binding library const userExists = ctx.prisma.exists.User({email: "awsd@gmail.com"}) i used this exist query but it keep giving me this "Promise { <pending> }" Can anyone tell me what am i doing wrong?
h
You need to resolve promise for example with
await
c
signup: async (parent, args, ctx, info) => { const password = await bcrypt.hash(args.password, 10) const userExists = ctx.prisma.exists.User({email: "awsd@gmail.com"}) console.log(userExists,"asdasd"); const user = await ctx.prisma.mutation.createUser({ data: { ...args, password }, }) return { token: jwt.sign({ userId: user.id },APP_SECRET), user, } }, Here is my function tho it keeps giving me this "Promise { <pending> } 'Console Data'"
h
Just add await in front of
ctx.prisma.exists.User({email: "<mailto:awsd@gmail.com|awsd@gmail.com>"})
c
Yes 🤗 Thanks