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
- Name
CollectionPage.*
- Type
- CollectionPage
- Description
Any requested field from the Collectionpage object.
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."
}
}
}