Back to Content Management API

pagePublish

Publishes a page.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the page you want to publish.

  • Name
    publishComment
    Type
    String
    Description

    An optional comment to include with the publish.

Returns

  • Name
    Page.*
    Type
    Page
    Description

    Any requested field from the page object.

Request

import { PackClient } from '@pack/client'
const packClient = new PackClient({
  token: 'YOUR-PACK-TOKEN'
});

const query = `
mutation PagePublish($id: ID!) {
  pagePublish(id: $id) {
    id
  }
}
`
const response = await packClient.fetch(query, { variables: { id: 'YOUR-PAGE-ID' } });
console.log(response.data);

Response

{
    "data": {
        "pagePublish": {
            "id": "page-id"
        }
    }
}

Was this page helpful?