Graphcool / graphcool-framework

Apache License 2.0
1.77k stars 131 forks source link

Unexpected error occurring on signup in the examples #572

Open noobling opened 5 years ago

noobling commented 5 years ago

Current behavior When following the read me for example located here: https://github.com/prisma/graphcool-framework/tree/master/examples/0.x/full-example and trying to execute this code

mutation signup {
  signupUser(
    email: "nilan@graph.cool"
    password: "password"
  ) {
    id
    token
  }
}

An unexpected error occurs upon further inspection of the log this is returned

{ Error: Field 'createUser' argument 'name' of type 'String!' is required but not provided. (line 3, column 7):\n      createUser(\n      ^: {\"response\":{\"data\":null,\"errors\":[{\"message\":\"Field 'createUser' argument 'name' of type 'String!' is required but not provided. (line 3, column 7):\\n      createUser(\\n      ^\",\"locations\":[{\"line\":3,\"column\":7}]}],\"status\":200},\"request\":{\"query\":\"\\n    mutation createGraphcoolUser($email: String!, $password: String!) {\\n      createUser(\\n        email: $email,\\n        password: $password\\n      ) {\\n        id\\n      }\\n   }\\n  \",\"variables\":{\"email\":\"nilan@graph.cool\",\"password\":\"$2a$10$JNnPjn0WMlMjaTSZZorzbudQPAwauMA.U/CMEBAyFfzCInvudTxXK\"}}}\n    at GraphQLClient.<anonymous> 

Reproduction Follow the read me here: https://github.com/prisma/graphcool-framework/tree/master/examples/0.x/full-example then try to execute this code

mutation signup {
  signupUser(
    email: "nilan@graph.cool"
    password: "password"
  ) {
    id
    token
  }
}

Expected behavior?

id and token is returned instead of an error.

noobling commented 5 years ago

Update you can fix this by just adding name for the signup function, can post code if anyone is having trouble still