Error in gatsby-source-shopify
See original GitHub issueDescription
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:
- Created 4 years ago
- Comments:6 (5 by maintainers)
@freiksenet I did it a try! Would you mind reviewing this PR ?
Thanks in advance
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:We’d love a PR with this feature, I wonder if you would be interested in doing it 😃
Thank you for using Gatsby! 💜 💪