I'm following the tutorial and its great, but I'm having an issue. I can create a User and a Link but when I run the query:
mutation {
login(
email: "[email protected]"
password: "graphql"
) {
token
user {
email
links {
url
description
}
}
}
}
I get the following error:
Error: Variable "$_v0_where" got invalid value {"email":"[email protected]"}; Field "email" is not defined by type UserWhereUniqueInput.
I have restarted the tutorial thinking it was an error earlier on, copy pasted the code to not make a typo but I keep getting the error.
I had the same issue while completing the tutorial. In your datamodel.graphql file, make sure the User's email field has the @unique directive set. That was exactly the problem in my case. And don't forget to redeploy your Prisma service after making changes to your data model.
I bump into a similar issue.
@chapran-leobit-acc Do you know why the email must be unique?
Thanks @christiaan-janssen for opening this issue 馃槃. It seems to be solved. Closing this for now, please, feel free to re-open an issue if you cannot make it work!
I ran into the same issue. The solution given by @chapran-leobit-acc fixed it for me.
I have the same issue.
Same issue. I checked my datamodel.prisma file and it has the @unique directive. Still does not work
Most helpful comment
I had the same issue while completing the tutorial. In your
datamodel.graphqlfile, make sure the User'semailfield has the@uniquedirective set. That was exactly the problem in my case. And don't forget to redeploy your Prisma service after making changes to your data model.