skip to Main Content

My problem is that I would like to connect my Shopify store with gatsby app. So I had installed gatsby-source-shopify, but when I added plugin to gatsby-config.js with shopName and accessToken and try to run gatsby develop, site renders as expected but it throws this error:

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

Does anyone know how to solve it?

2

Answers


  1. Try installing the shopify-buy package.

    Login or Signup to reply.
  2. I had the same problem and solved it by coping the “Storefront access token” under storefront api permissions and not the “API token”.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search