Hi there,
The Shopify app I’m building is having issues with the themeFilesUpsert mutation:
https://shopify.dev/docs/api/admin-graphql/2025-01/mutations/themeFilesUpsert
I’ve already had my exemption request approved, which is necessary from Shopify to use the mutation, and I
I already have access to the scope for write_themes, which my app requests when installing the Shopify app.
These are all of the scopes that are requested to have access granted by the Shopify store:
‘read_checkout_branding_settings,read_content,write_content,read_online_store_pages,unauthenticated_read_metaobjects,read_metaobjects,write_metaobjects,read_metaobject_definitions,write_metaobject_definitions,read_products,read_themes,write_themes’
However, with all of this, I’m still getting a denied error in my console, preventing me from using the mutation:
“Access denied for themeFilesUpsert field. Required access: The user needs write_themes and an exemption from Shopify to modify theme files. If you think that your app is eligible for an exemption and should have access to this API, then you can [submit an exception request].”
This is my GQL Admin Api mutation:
const query = `
mutation themeFilesUpsert($files: [OnlineStoreThemeFilesUpsertFileInput!]!, $themeId: ID!) {
themeFilesUpsert(files: $files, themeId: $themeId) {
upsertedThemeFiles {
filename
}
userErrors {
field
message
}
}
}
`;
const variables = {
themeId,
files: [
{
filename: `templates/${templateDB[0].fileType}.${templateDB[0].templateSuffix}.liquid`,
body: {
type: 'TEXT',
value: templateDB[0].html
}
}
]
};
Is there any insight on how to fix this denied error?
Thank you