Back to Content Management API
contentReleaseMovePageChanges
Creates a new content release from a published page's current unpublished section changes, then restores the page and its sections to their baseline revisions. Send this mutation without the X-Pack-Release-Id header. Page fields that are not revisioned, such as the template, cannot be moved.
Arguments
- Name
input- Type
- ContentReleaseMovePageChangesInput!
- Description
An object.
pageId:ID!The page whose changes you want to move.name:StringThe new release name. Defaults to the page title followed by "changes".description:StringbaselinePageRevisionId:IDThe page revision to restore the page to. Defaults to the published revision.sectionBaselines:[ContentReleaseMoveSectionBaselineInput!]Per-section baseline revisions, each withsectionId: ID!andrevisionId: ID!.
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 ContentReleaseMovePageChanges($input: ContentReleaseMovePageChangesInput!) {
contentReleaseMovePageChanges(input: $input) {
id
name
drafts {
contentType
contentId
}
}
}
`
const variables = {
input: {
pageId: 'page-id',
name: 'Homepage refresh',
},
}
const response = await packClient.fetch(query, { variables })
console.log(response.data)
Response
{
"data": {
"contentReleaseMovePageChanges": {
"id": "release-id",
"name": "Homepage refresh",
"drafts": [
{
"contentType": "page",
"contentId": "page-id"
},
{
"contentType": "section",
"contentId": "section-id"
}
]
}
}
}