【问题标题】:gatsby-source-shopify and graphql error an error occurred while sourcing datagatsby-source-shopify 和 graphql 错误 采购数据时发生错误
【发布时间】:2020-05-24 05:47:11
【问题描述】:

我的问题是我想将我的 Shopify 商店与 gatsby 应用程序连接起来。所以我已经安装了 gatsby-source-shopify,但是当我使用 shopName 和 accessToken 将插件添加到 gatsby-config.js 并尝试运行 gatsby develop 时,站点按预期呈现,但它抛出了这个错误:

gatsby-source-shopify/gatsby-ecommerce-testing starting to fetch data from Shopify

 ERROR 


error an error occurred while sourcing data


 ERROR 

query: 
  """

      query GetCollections($first: Int!, $after: String) {
        collections(first: $first, after: $after) {
          pageInfo {
            hasNextPage
          }
          edges {
            cursor
            node {
              description
              descriptionHtml
              handle
              id
              image {
                altText
                id
                src
              }
              products(first: 250) {
                edges {
                  node {
                    id
                  }
                }
              }
              title
              updatedAt
            }
          }
        }
      }

  """
variables: 
  first: 250
  after: null

有人知道怎么解决吗?

【问题讨论】:

  • 我也遇到了这个问题。我认为这可能是特定于商店或(高)数量的产品,因为当我尝试使用 1 种产品的假商店时,它工作正常。
  • 我认为这个问题是因为我没有在 gatsby 应用程序中安装 graphql 插件,但我会检查这是不是真的
  • 你有多少产品?你看过 gatsby starter 文件了吗? gatsbyjs.org/starters/AlexanderProd/gatsby-shopify-starter

标签: javascript reactjs graphql gatsby


【解决方案1】:

我遇到了同样的问题,并通过在店面 api 权限下处理“店面访问令牌”而不是“API 令牌”来解决它。

【讨论】:

  • 但是你把它粘贴到哪里了?
【解决方案2】:

尝试安装shopify-buy 包。

【讨论】:

    猜你喜欢
    • 2019-09-29
    • 1970-01-01
    • 2021-05-08
    • 1970-01-01
    • 2021-07-28
    • 2022-07-28
    • 2019-08-16
    • 2023-01-08
    • 1970-01-01
    相关资源
    最近更新 更多