Shopify graphql客户创建

时间:2019-02-05 17:33:09

标签: graphql shopify

将店面api与graphql-yoga服务器一起使用。打开操场来测试查询和变异。

根据文档,这对于创建客户应该有效

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

任何人都可以帮助

1 个答案:

答案 0 :(得分:0)

在Shopify管理员中打开客户帐户。如果将其关闭,则无法创建客户是有意义的。