gpt4 book ai didi

javascript - 如何进行 ShopifyQL 查询?

转载 作者:行者123 更新时间:2023-12-05 00:38:44 31 4
gpt4 key购买 nike

Shopify 最近宣布 ShopifyQL以便更轻松地访问分析数据。但是,我不清楚如何实际调用 ShopifyQL 电话。它们确实包括 example .

{
# "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 服务器使用上面的示例查询进行经过身份验证的调用,但遇到了同样的问题。
我在这里想念什么?

最佳答案

看起来它仅适用于当前的不稳定版本:
https://"+shop_name+".myshopify.com/admin/api/unstable/graphql.json
得到了成功的回应。

关于javascript - 如何进行 ShopifyQL 查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72835644/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com