Back to Content Management API

collectionPageUnpublish

Unpublishes collection page.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the collection page you want to unpublish.

Returns

Request

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

const query = `
  mutation CollectionPageUnpublish($id: ID!) {
    collectionPageUnpublish(id: $id) {
      id
      title
      handle
      description
    }
  }
`;

const variables = {
  id: 'YOUR-COLLECTION-PAGE-ID'
};

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

Response

{
  "data": {
    "collectionPageUnpublish": {
      "id": "60f4b3b3b3b3b3b3b3b3b3b",
      "title": "My Collection Page",
      "handle": "my-collection-page",
      "description": "This is my collection page."
    }
  }
}

Was this page helpful?