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: String The new release name. Defaults to the page title followed by "changes".
    • description: String
    • baselinePageRevisionId: ID The page revision to restore the page to. Defaults to the published revision.
    • sectionBaselines: [ContentReleaseMoveSectionBaselineInput!] Per-section baseline revisions, each with sectionId: ID! and revisionId: ID!.

Returns

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"
        }
      ]
    }
  }
}

Was this page helpful?