Back to Content Management API

pageRestore

Restores a page to a specific revision.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the page you want to restore.

  • Name
    revisionId
    Type
    ID!
    Description

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

Returns

  • Name
    Page.*
    Type
    Page
    Description

    Any requested field from the page object.

Request

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

const query = `
mutation PageRestore($id: ID!, $revisionId: ID!) {
  pageRestore(id: $id, revisionId: $revisionId) {
    id
    revisionId 
  }
}
`
const response = await packClient.fetch(query, { variables: { id: "your-page-id", revisionId: "your-revision-id" } });
console.log(response.data);

Response

{
    "data": {
        "PageRestore": {
            "id": "your-page-id",
            "revisionId": "your-revision-id"
        }
    }
}

Was this page helpful?