Dear Colleagues,
I am running into a frustrating permissions issue with the GraphQL Admin API while querying theme files, and I want to confirm if my understanding of Shopify’s security model here is correct.
The Setup:
My app has the following scopes requested:
-
write_themes -
read_themes
I am running the following GraphQL query to read a specific theme file (templates/test.json):
GraphQL
query {
themes(first: 10) {
edges {
node {
name
id
role
files (first: 10, filenames: ["templates/test.json"]) {
edges {
node {
filename
body {
... on OnlineStoreThemeFileBodyText {
content
}
}
contentType
}
}
}
}
}
}
}
The Problem:
The app is installed on several dev-stores. The GraphQL works on all dev-stores except one. For the failing dev-store, it returns.
path: [ 'themes', 'edges', 2, 'node', 'files' ],
extensions: {
code: 'ACCESS_DENIED',
documentation: 'https://shopify.dev/api/usage/access-scopes'
}
My Questions:
Do you have any idea why the GraphQL works on all dev-stores except one? Thank you in advance.