CMS Page — Delete
Deletes a CMS page. Equivalent to DELETE /api/admin/cms/pages/{id}.
Prerequisites
Replace the example id with a CMS page id that exists in your store — use the adminCmsPages query to find one.
Operation
| Operation | Type |
|---|---|
deleteAdminCmsPage | Mutation |
Input
| Field | Type | Required | Notes |
|---|---|---|---|
id | ID! | yes | Resource IRI — /api/admin/cms/pages/{id}. |
What it returns
The mutation returns a snapshot of the deleted page, captured just before removal, so you can confirm what was deleted in the same round trip. The scalar fields all resolve — id, _id, urlKey, pageTitle, htmlContent, metaTitle, metaKeywords, metaDescription, locale. Select the fields you want to log or display.
Confirming success vs. failure
Select the message field to get the human-readable success confirmation ("CMS page deleted successfully."). The contract:
- Success →
data.deleteAdminCmsPage.adminCmsPageis non-null,messagecarries the confirmation, anderrorsis absent. - Failure →
data.deleteAdminCmsPageisnulland the reason is in the top-levelerrorsarray (page not found, no permission, or a deletion failure).messageis only populated on success.
(message is null on read / list / detail queries — it is an action result, meaningful only on the delete mutation.)
translations and channels come back empty
The translations and channels connections are re-read from the database when resolved, but the row (and its translation / channel rows) are already gone at that point — so those connections return empty edges on a delete result. To capture per-locale content before deleting, query the detail first. Scalar fields like urlKey / pageTitle are taken from the in-memory snapshot and do resolve.
Deleting a page also removes any storefront redirects (url rewrites) that pointed at its slugs.
Errors
| Condition | Result |
|---|---|
| Page ID not found | not-found error |
Admin role lacks cms.delete | permission error |

