jackowsky
jackowsky

Reputation: 57

gatsby-source-shopify and graphql error an error occurred while sourcing data

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?

Upvotes: 0

Views: 866

Answers (2)

Dalup
Dalup

Reputation: 41

I had the same problem and solved it by coping the "Storefront access token" under storefront api permissions and not the "API token".

Upvotes: 4

G. Lovell
G. Lovell

Reputation: 11

Try installing the shopify-buy package.

Upvotes: 1

Related Questions