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

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"
    }
  }
}

Was this page helpful?