graphql - Shopify graphql 客户创建

标签 graphql shopify

将店面 api 与 graphql-yoga 服务器一起使用。打开 playground 以测试查询和变更。

根据文档,这应该适用于创建客户

mutation  {
      customerCreate(
        input: {
          firstName: "dave",
          lastName: "smith",
          email: "davesmith@gmail.com",
          password: "HiZqFuDvDdQ7",
          acceptsMarketing: true
            }
      ) {
        customer {
          id
          firstName
          lastName
          email
        }
        customerUserErrors {
          field
          message
        }
        customer {
          id
        }
      }
    }

然而这会返回一个错误

{
  "data": {
    "customerCreate": null
  },
  "errors": [
    {
      "message": "Customer accounts are disabled.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "customerCreate"
      ]
    }
  ]
}

谁能帮忙

最佳答案

在您的 Shopify 后台中启用客户帐户。如果它们被关闭,那么您无法创建客户是有道理的。

关于graphql - Shopify graphql 客户创建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54540045/

相关文章:

javascript - 如何导入 Polaris React 组件?

javascript - 在按钮上添加加载状态 - Reactjs Shopify Polaris

node.js - Node.js 环境中的水平缩放和 GraphQL

Android Shopify 移动购买版本 - 3.1.1 Retryhandler 错误

graphql - 升级到 graphql-js 15.0.0 会中断工作配置并显示消息 : Field "[...]" already exists in the schema

javascript - Shopify GraphQL CustomerAccessToken

javascript - 为什么 fetch 函数说,即使我设置了代理,我也必须使用绝对 url?

javascript - 如何使用 shopify Polaris DropZone 组件上传图片

graphql - 从 Schema 生成 GraphQL GUI 和从 GUI 生成 Schema

node.js - 在 GraphQL 中处理 Mongoose 填充字段