While following the How To GraphQL `hackernews-nod...
# prisma1-community
j
While following the How To GraphQL
hackernews-node
tutorial, a couple issues came up and I was hoping to verify the behavior I saw with the Prisma team. First, the
AuthPayload
in the schema.graphql file appears to be misconfigured since the
user
field is defined as having a required
String!
argument. However, when using the
signup
mutation, an error is returned indicating that
Copy code
Field \"user\" must not have a selection since type \"String!\" has no subfields.
This is because the query provided in the tutorial has the two fields from the
AuthPayload
as return values. So, I updated the schema for the user field to include
User!
. Now, when I execute the
signup
mutation, it performs as expected. However, when an attempt is made to use the
login
mutation, this message is returned:
Copy code
Variable '$where' expected value of type 'UserWhereUniqueInput!' but got: {\"email\":\"<mailto:alice@prisma.io|alice@prisma.io>\"}. Reason: 'email' Field 'email' is not defined in the input type 'UserWhereUniqueInput'. (line 1, column 8):\nquery ($where: UserWhereUniqueInput!) {\n       ^
j
(I have indeed no idea.) Ping @Ryan
j
Thanks for your reply, @janpio. 🙏 I’ll connect with Ryan.
j
(Oh I did ping him - he will see this an possibly be able to help out. But let's hope some other user can already help you.)
👍 1
r
Hey @James Potts 👋 Regarding the login mutation not working, I think it is due to email not present in
UserWhereUniqueInput
Could you check if email is set to
@unique
in the Prisma datamodel. Also as you're getting started with Prisma, I would strongly suggest Prisma 2 here as it is stable and in active development.