Graphql query theme file content return wrong format

I’m checking if my app embed block is enabled by query setting_data.json

{
  themes(roles: MAIN, first: 1) {
    nodes {
      files(filenames: "*settings_data.json") {
        nodes {
          filename
          body {
            ... on OnlineStoreThemeFileBodyText {
              content
            }
          }
        }
      }
    }
  }
}

But from yesterday, the query content will include the comment warning “IMPORTANT: The contents of this file are auto-generated.\n *\n * This file may be updated by the Shopify admin theme editor\n * or related systems. Please exercise caution as any changes\n * made to this file may be overwritten.” at the beginning of the file so I can’t use JSON.parse. I had to temporarily switch to rest api and everything was fine.

2 Likes

Did you find a fix to this? Finding the same issue of the GraphQL query returning incomplete raw file content, never mind the same issue you’ve mentioned of the comment at the start of the returned data. Using REST is fine for us too, but we all know we’ll likely have to change this again later as a result

Did you find a fix?