We recently migrated from using the REST Asset API to the themes
GraphQL query to fetch the config/settings_data.json
file for checking if our app embed is enabled. Initially, this approach worked well, as the content returned by the query was a stringified JSON file.
However, we’ve now noticed that the content returned by the themes
query includes comments at the top of the JSON file (see attached screenshots). This is causing issues with our JSON parsing, as our code expects a pure JSON format. In contrast, when fetching the same file using the REST API (e.g., templates/product.json
), the response contains only the JSON content, with comments automatically excluded.
It seems the behavior of the themes
query has changed—it used to exclude comments but no longer does. This is breaking our app. Is there an alternative way to fetch the file in a JSON-only format, or a recommended solution to handle this change?
Rest api response — Screenshot uploaded to CleanShot Cloud
GraphQl api response – Screenshot uploaded to CleanShot Cloud