将店面 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/