Back to Content Management API

pageUpdateBulk

Allows you to bulk update product pages.

Arguments

  • Name
    ids
    Type
    [ID!]
    Description

    Array of product page IDs that you want to update.

  • Name
    input
    Type
    [ProductPageUpdateInput!]!
    Description

    Array of objects for each corresponding page ID to update.

    • title: String
    • firstPublishedAt: DateTime
    • firstPublishedAtTimezone: String
    • description: String
    • template: String
    • sectionIds: [ID!]

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 ProductPageUpdateBulk($ids: [ID!]!, $input: [ProductPageUpdateInput!]!) {
    productPageUpdateBulk(ids: $ids, input: $input) {
      id
    }
  }
`;

const variables = {
  "ids": ["product-page-id-1", "product-page-id-2"],
  "input": [
    {
      "title": "New Title",
      "firstPublishedAt": "2022-01-01T00:00:00Z",
      "firstPublishedAtTimezone": "America/New_York",
      "description": "New Description",
      "template": "New Template",
      "sectionIds": ["section-id-1", "section-id-2"]
    },
    {
      "title": "New Title 2",
      "firstPublishedAt": "2022-01-01T00:00:00Z",
      "firstPublishedAtTimezone": "America/New_York",
      "description": "New Description 2",
      "template": "New Template 2",
      "sectionIds": ["section-id-3", "section-id-4"]
    }
  ]
};
  

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

Response

{
    "data": {
        "productPageUpdateBulk": {
          "id": "1"
        }
    }
}

Was this page helpful?