Trying to get this mutation to work: <https://grap...
# prisma-whats-new
e
Trying to get this mutation to work: https://graphqlbin.com/04Qsr
d
Looks like you are missing a comma between your mutation parameters.
Copy code
mutation {
  signup(email: "<mailto:eric@yoyo.com|eric@yoyo.com>", password: "password") {
    token 
    user {
      id
    }
  }
}
e
ok, thank you. Still the same error
seems like the error is saying that it is not receiving something that it supposed to receive.
d
Double check the parameters your signup mutation is set to receive (using the schema explorer pane on the right hand side).
e
ok
signup( email: String! password: String! ): AuthPayload!
the detail says: type AuthPayload { token: String! user: User! }
My understanding is that the auth payload goes in the HTTP header
d
What exactly is the error?
e
Cannot return null for non-nullable field Mutation.signup.”
“locations”: [ { “line”: 3, “column”: 3
I think the location means the email/password, but I don’t know
q
not sure what you're working on. Could it expect an additional name argument for the signup mutation and email + password for login?
e
I’m working with the prisma examples auth. I put that code into the react fullstack basic. The mutation that I tried is on the readme for the auth example. Thanks for looking!
q
so you added the User type in database/datamodel.graphql youself? The signup mutation should probably be similar to this: signup(parent, args, ctx, info) { const password = await bcrypt.hash(args.password, 10) const user = await ctx.db.mutation.createUser({ data: { ...args, password }, }) const token = jwt.sign({ userId: user.id }, APP_SECRET) return { token, user, } }
e
Yes, I think I have been trying the wrong playground! Still trying to figure out how to get the right one running.