2

我正在运行示例应用程序。我在 graphcool 中为 createUser 调用了突变。但我收到如下截图所示的错误。这是我的代码

  this.props
      .createUser({
        variables: {
          email: this.state.email,
          password: this.state.password
        }
      })
      .then(({ data }) => {
        alert(JSON.stringify(data))
      })
      .catch(error => {
        alert('There is a problem ' + error)
      })

const CREATE_USER = gql`
  mutation createUser(authProvider:{email:{$email: String, $password: String}}) {
    createUser(email: $email, password: $password) {
      id
      email
      password
    }
  }
`
const RegisterData = compose(graphql(CREATE_USER, { name: 'createUser' }))(Register)

导出默认注册数据

这是我的截图: 在此处输入图像描述

4

0 回答 0