Access Denied Error When Fetching files in Theme via GraphQL

Hi everyone,

I’ve recently developed a new Shopify app that includes a theme app extension. As part of my logic, I need to check whether the extension is active by reading from the settings_data.json file inside the current theme. For that, I’m using the following GraphQL query:

query GetStoreThemes {
  themes(first: 20) {
    edges {
      node {
        id
        name
        role
        files(filenames: ["config/settings_data.json"]) {
          edges {
            node {
              body {
                ... on OnlineStoreThemeFileBodyText {
                  content
                }
              }
            }
          }
        }
      }
    }
  }
}

I’ve already granted the following scopes to the app:

  • read_themes
  • write_themes
  • read_files
  • write_files

However, I’m getting this error in response:

{
  "errors": [
    {
      "message": "Access denied",
      "locations": [
        { "line": 8, "column": 17 }
      ],
      "path": ["themes", "edges", 6, "node", "files"],
      "extensions": {
        "code": "ACCESS_DENIED",
        "documentation": "https://shopify.dev/api/usage/access-scopes"
      }
    }
  ]
}

I’ve also attached screenshots that show the scopes and the GraphQL response for better context.

Can anyone help me figure out what’s missing? Is there a permission or specific requirement I’m overlooking when accessing files in themes?

Thanks in advance!


1 Like

@KyleG-Shopify I have also discovered the same issue, is this a bug?

Hey, thanks for the ping.

Testing on my end, I’m not getting the same error, but I’m also only getting partial themes returned.

Can you confirm the API version you are using and if possible the x-request-id of the response returning the error?

Hi, thanks for getting back to me.
I tested it again and the error is now gone. I redeployed the application, and everything is working properly now. I’m using the April 2025 version.

Thanks again!

1 Like