question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in gatsby-source-shopify

See original GitHub issue

Description

I am getting the following error during npm run develop:

gatsby-source-shopify/<shop-name> starting to fetch data from Shopify
error
error an error occured while sourcing data
error - 
  message:   access denied
  locations: 
    - 
      line:   4
      column: 7
  path: 
    - shop
    - blogs
error query: 
  """

      query GetBlogs($first: Int!, $after: String) {
        shop {
          blogs(first: $first, after: $after) {
            pageInfo {
              hasNextPage
            }
            edges {
              cursor
              node {
                id
                title
                url
              }
            }
          }
        }
      }

  """
variables: 
  first: 250
  after: null

Steps to reproduce

Create a Storefront API Access Token that doesn’t have access to “Read content like articles, blogs, and comments” and try to run gatsby

Expected result

Site builds with only the queries I provide and successfully builds.

Actual result

Unknown query is running and erroring. No where in my site am I running this query so I wouldn’t expect it to run. My site doesn’t need blogs from Shopify. The error is expected, the fact that it is running is not.

Environment

System: OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver) CPU: (8) x64 AMD EPYC 3251 8-Core Processor Shell: 4.4.19 - /bin/bash Binaries: Node: 12.2.0 - ~/.nvm/versions/node/v12.2.0/bin/node npm: 6.9.0 - ~/.nvm/versions/node/v12.2.0/bin/npm npmPackages: gatsby: ^2.9.4 => 2.9.4 gatsby-image: ^2.1.4 => 2.1.4 gatsby-plugin-manifest: ^2.1.1 => 2.1.1 gatsby-plugin-offline: ^2.1.3 => 2.1.3 gatsby-plugin-react-helmet: ^3.0.12 => 3.0.12 gatsby-plugin-sharp: ^2.1.5 => 2.1.5 gatsby-source-filesystem: ^2.0.39 => 2.0.39 gatsby-source-graphql: ^2.0.19 => 2.0.19 gatsby-source-shopify: ^2.0.32 => 2.0.32 gatsby-transformer-sharp: ^2.1.21 => 2.1.21 npmGlobalPackages: gatsby-cli: 2.6.7

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
martingtheodocommented, Jun 28, 2019

gatsby-source-shopify doesn’t currently have any way to limit what it queries for, so your token should have rights to access everything that it’s trying to fetch.

It’s possible to add this as configuration to gatsby-source-shopify, it could be something like:

fetchCollections: [`ARTICLES`, `BLOGS`, `PRODUCTS`]

We’d love a PR with this feature, I wonder if you would be interested in doing it 😃

Thank you for using Gatsby! 💜 💪

@freiksenet I did it a try! Would you mind reviewing this PR ?

Thanks in advance

1reaction
freiksenetcommented, Jun 20, 2019

gatsby-source-shopify doesn’t currently have any way to limit what it queries for, so your token should have rights to access everything that it’s trying to fetch.

It’s possible to add this as configuration to gatsby-source-shopify, it could be something like:

fetchCollections: [`ARTICLES`, `BLOGS`, `PRODUCTS`]

We’d love a PR with this feature, I wonder if you would be interested in doing it 😃

Thank you for using Gatsby! 💜 💪

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR #gatsby-source-shopify_111001 Could not ... - GitHub
I have setup my shopify private app, configured environment variables and added the plugin to the gatsby-config.js file according to the ...
Read more >
ERROR #gatsby-source-shopify_111002 - Shopify Community
Hi, am using Shopify & Gatsby for an online store. It worked well, but I recently ran into an issue where I can't...
Read more >
gatsby-source-shopify-translated
Source plugin for pulling data into Gatsby from Shopify stores via the Shopify Storefront API and supports Translation API. Features. Provides public shop...
Read more >
gatsby-source-shopify and graphql error an error occurred ...
I'm having this issue as well. I think it may be something specific to the store or the (high) number of products, because...
Read more >
gatsby-source-shopify-admin - npm
This is a Gatsby source plugin to pull data from Shopify using the Admin APIs. This plugin was recently (Q1 2020) re-written to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found