Howtographql: Node js - Authentication - Field "email" is not defined by type UserWhereUniqueInput.

Created on 24 May 2018  路  6Comments  路  Source: howtographql/howtographql

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.

Needs Investigation

Most helpful comment

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.

All 6 comments

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

Was this page helpful?
0 / 5 - 0 ratings