Back to Content Management API

collectionPagePublishBulk

Bulk publish collection pages.

Arguments

  • Name
    ids
    Type
    [ID!]
    Description

    Array of collection page IDs that you want to publish.

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 CollectionPagePublishBulk($ids: [ID!]!) {
    collectionPagePublishBulk(ids: $ids) {
      id
    }
  }
`;

const variables = {
  ids: ['<COLLECTION_PAGE_ID>', '<COLLECTION_PAGE_ID>']
};

const response = await packClient.fetch(query, { variables: variables });
console.log(response.data);

Response

{
    "data": {
        "collectionPagePublishBulk": {
          "id": "1"
        }
    }
}

Was this page helpful?