如何进行ShopifyQl查询?

发布于 2025-02-12 12:15:40 字数 1760 浏览 0 评论 0原文

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

我还尝试使用我的应用程序的节点服务器进行以上查询的示例查询进行认证的调用,但遇到了相同的问题。

我在这里想念什么?

Shopify recently announced ShopifyQL for easier accessing of analytics data. However, I'm unclear of how to actually make a ShopifyQL call. They do include an 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
        }
      }
    }
  }
}

However, using the GraphiQL tool to run the query hits a number of errors:

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

I also tried making an authenticated call with the example query above using my app's Node server, but ran into the same issues.

What am I missing here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

平安喜乐 2025-02-19 12:15:40

看来它仅适用于当前不稳定版本:

https://“+shop_name+” .myshopify.com/admin/admin/api/api/dograble/graphql.json

成功地响应了这一点。

Looks like it only works with the unstable version currently:

https://"+shop_name+".myshopify.com/admin/api/unstable/graphql.json

Got a successful response with this.

握住你手 2025-02-19 12:15:40

这仍然对您有用吗?
https://storename.myshopify.com/admin/admin/api/api/unstable/graphql。 JSON

这是过去6个月的工作。但是现在它被拒绝了。
“代码”:“ access_denied”,
“文档”:“ https://shopify.dev/api/usage/access-scopes”,
“必需访问”:“ read_reports访问范围,read_customers访问范围,read_felfillments访问范围,read_inventory访问范围,访问范围,<代码> read_orders 访问范围,read_products访问范围和read_all_orders访问范围”
}

Is this still working for you?
https://storename.myshopify.com/admin/api/unstable/graphql.json

This was working for past 6 months. but now it getting access denied.
"code": "ACCESS_DENIED",
"documentation": "https://shopify.dev/api/usage/access-scopes",
"requiredAccess": "read_reports access scope, read_customers access scope, read_fulfillments access scope, read_inventory access scope, read_orders access scope, read_products access scope and read_all_orders access scope"
}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文