Search code examples
auth0relaygraphcool

400 error when trying to create a new user via createUser Mutation


When attempting to create a new user with the createUser mutation having just received the idToken from the Auth0 request, I receive the following error:

{
  "data": null,
  "errors": [{
    "message": "Variable '$input_0' expected value of type 'SignupUserInput!' but got: {\"authProvider\":{\"auth0\":{\"idToken\":\"__idToken_Recieved_From_auth0_request__"}},\"clientMutationId\":\"0\"}. Reason: [in field 'name'] Expected non-null value, found null. (line 1, column 29):\nmutation CreateUserMutation($input_0:SignupUserInput!) {\n                                ^",
    "locations": [{
      "line": 1,
      "column": 29
    }]
  }]
}

Any suggestions?


Solution

  • It looks like your User model has a required name field. If that is the case then you need to also add it to the mutation.