Back to Content Management API
contentReleaseRemoveDraft
Removes a content item's draft from an open content release. Live content is not changed.
Arguments
- Name
releaseId- Type
- ID!
- Description
The ID of the release.
- Name
contentType- Type
- ContentReleaseDraftType!
- Description
The type of content the draft belongs to:
page,article,blog,product,collection,siteSettings,section, ortemplate.
- Name
contentId- Type
- ID!
- Description
The ID of the content item.
Returns
- Name
ContentRelease.*- Type
- ContentRelease!
- Description
Any requested field from the ContentRelease object.
Request
import { PackClient } from '@pack/client'
const packClient = new PackClient({
token: 'YOUR-PACK-TOKEN',
})
const query = `
mutation ContentReleaseRemoveDraft($releaseId: ID!, $contentType: ContentReleaseDraftType!, $contentId: ID!) {
contentReleaseRemoveDraft(releaseId: $releaseId, contentType: $contentType, contentId: $contentId) {
id
drafts {
contentType
contentId
}
}
}
`
const variables = {
releaseId: 'release-id',
contentType: 'section',
contentId: 'section-id',
}
const response = await packClient.fetch(query, { variables })
console.log(response.data)
Response
{
"data": {
"contentReleaseRemoveDraft": {
"id": "release-id",
"drafts": [
{
"contentType": "page",
"contentId": "page-id"
}
]
}
}
}