In this guide, you will learn about how to delete a theme using a GraphQL mutation.
To delete a theme, you should make a GraphQL deleteTheme mutation.
In the backend, this mutation removes the theme json file, its associated theme directory (if it exists), and any file in the directory and commits the changes into the git repository.
deleteTheme mutation
The query for your mutation is given below.
mutation deleteTheme($themeId: String!, $removeOrReplaceScopes: Boolean, $replacementThemeId: String){
deleteTheme(themeId: $themeId, removeOrReplaceScopes: $removeOrReplaceScopes, replacementThemeId: $replacementThemeId){
result
removedAssets{
name
directoryName
subDirectoryName
feature
}
errors{
__typename
... on ThemeNotFoundError {
message
fields
themeId
}
... on ReplacementThemeNotFoundError {
message
fields
themeId
}
}
}
}
The variables for the above query are given below.
{
"themeId": "myAwesomeTheme",
"removeOrReplaceScopes": true,
"replacementThemeId": "myOtherTheme"
}
ATLAS
Comments