Back to Content Management API
collectionPageRestore
Restores a collection page to a specific revision.
Arguments
- Name
id
- Type
- ID!
- Description
The ID of the collection page you want to restore.
- Name
revisionId
- Type
- ID!
- Description
The ID of the revision you want to use to restore.
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 CollectionPageRestore($id: ID!, $revisionId: ID!) {
collectionPageRestore(id: $id, revisionId: $revisionId) {
id
title
handle
description
}
}
`;
const variables = {
id: 'YOUR-COLLECTION-PAGE-ID',
revisionId: 'YOUR-REVISION-ID'
};
const response = await packClient.fetch(query, { variables: variables });
console.log(response.data);
Response
{
"data": {
"collectionPageRestore": {
"id": "1",
"title": "Collection Page Title",
"handle": "collection-page-title",
"description": "Collection Page Description"
}
}
}