【问题标题】:400 error when trying to create a new user via createUser Mutation尝试通过 createUser Mutation 创建新用户时出现 400 错误
【发布时间】:2017-03-23 12:06:33
【问题描述】:

当尝试使用刚刚从 Auth0 请求接收到 idToken 的 createUser 突变创建新用户时,我收到以下错误:

{
  "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
    }]
  }]
}

有什么建议吗?

【问题讨论】:

    标签: auth0 relay graphcool


    【解决方案1】:

    看起来您的用户模型有一个必需的名称字段。如果是这种情况,那么您还需要将其添加到突变中。

    【讨论】:

    • 啊,是的。非常感谢!
    猜你喜欢
    • 1970-01-01
    • 2012-12-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-22
    相关资源
    最近更新 更多