【问题标题】:GraphiQL 404 page not found未找到 GraphiQL 404 页面
【发布时间】:2019-05-08 15:21:44
【问题描述】:

基于这个 Shopify documentation,我正在尝试执行这个 GraphQL 查询:

query getDiscount($code: DiscountCodeSortKeys) {
  priceRules(first: 1) {
    edges {
      node {
        discountCodes(first: 1, sortKey: $code) {
          edges {
            node {
              code
              id
            }
          }
        }
      }
    }
  }
}

在我的 Shopify 管理页面的 GraphiQL 中,我得到以下输出:

{
  "data": {
    "priceRules": {
      "edges": [
        {
          "node": {
            "discountCodes": {
              "edges": [
                {
                  "node": {
                    "code": "discount_code_1",
                    "id": "gid://shopify/PriceRuleDiscountCode/1888888"
                  }
                }
              ]
            }
          }
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 6,
      "actualQueryCost": 6,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 994,
        "restoreRate": 50
      }
    }
  }
}

但是,当我在编辑 HTTP 标头并放置 GraphQL 端点 (https://my_domain.com/api/graphql) 后在 GraphiQL IDE 中执行相同的查询时,我得到一个标题为 404 页面的 html 代码,如图所示下面:

【问题讨论】:

    标签: graphql shopify storefront graphiql


    【解决方案1】:

    问题出在选择的方法“GET”中,当我选择“POST”方法时它起作用了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-15
      • 2015-05-19
      • 2016-06-22
      相关资源
      最近更新 更多