Shopify最近宣布了ShopifyQL,以便更容易地访问分析数据。然而,我不清楚如何真正地打一个ShopifyQL电话。他们确实包括一个示例。
{
# "FROM sales SHOW total_sales BY month SINCE -1y UNTIL today" passes a ShopifyQL query to the GraphQL query.
shopifyqlQuery(query: "FROM sales SHOW total_sales BY month SINCE -1y UNTIL today") {
__typename
... on TableResponse {
tableData {
rowData
columns {
# Elements in the columns section describe which column properties you want to return.
name
dataType
displayName
}
}
}
# parseErrors specifies that you want errors returned, if there were any, and which error properties you want to return.
parseErrors {
code
message
range {
start {
line
character
}
end {
line
character
}
}
}
}
}
但是,使用GraphiQL工具运行查询会遇到一些错误:
{
"errors": [
{
"message": "Field 'shopifyqlQuery' doesn't exist on type 'QueryRoot'",
"locations": [
{
"line": 3,
"column": 3
}
],
"path": [
"query",
"shopifyqlQuery"
],
"extensions": {
"code": "undefinedField",
"typeName": "QueryRoot",
"fieldName": "shopifyqlQuery"
}
}
]
}
我还尝试使用我的应用程序的Node服务器使用上面的示例查询进行身份验证调用,但遇到了同样的问题。
我在这里错过了什么?
发布于 2022-07-06 16:04:30
https://stackoverflow.com/questions/72835644
复制相似问题