Back to Content Management API

pageUnpublishBulk

Bulk unpublish pages.

Arguments

  • Name
    ids
    Type
    [ID!]
    Description

    Array of page IDs that you want to unpublish.

Returns

  • Name
    Job
    Type
    Job
    Description

    Any requested field from the Job object.

Request

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

const query = `
mutation PageUnpublishBulk($ids: [ID!]!) {
  pageUnpublishBulk(ids: $ids) {
    id
  }
}
`
const variables = {
  ids: [
      "page-id-1",
      "page-id-2"
  ]
}
const response = await packClient.fetch(query, { variables: variables });
console.log(response.data);

Response

  {
      "data": {
          "pageUnpublishBulk": {
              "id": "1",
          }
      }
  }

Was this page helpful?