Back to Content Management API

productPageRestore

Restores a product page to a specific revision.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the product page you want to restore.

  • Name
    revisionId
    Type
    ID!
    Description

    The ID of the revision you want to use to restore.

Returns

  • Name
    ProductPage.*
    Type
    ProductPage
    Description

    Any requested field from the Productpage object.

Request

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

const query = `
  mutation ProductPageRestore($id: ID!, $revisionId: ID!) {
    productPageRestore(id: $id, revisionId: $revisionId) {
      id
      title
      handle
      description
    }
  }
`;

const variables = {
  id: 'YOUR-PAGE-ID',
  revisionId: 'YOUR-REVISION-ID'
};

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

Response

{
  "data": {
    "productPageRestore": {
      "id": "YOUR-PAGE-ID",
      "title": "YOUR-PAGE-TITLE",
      "handle": "YOUR-PAGE-HANDLE",
      "description": "YOUR-PAGE-DESCRIPTION"
    }
  }
}

Was this page helpful?