Back to Content Management API

pageHistory

Returns array of all revisions for the page by ID paginated by a cursor.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the page.

  • Name
    after
    Type
    String
    Description

    Returns the elements that come after the specified cursor.

  • Name
    before
    Type
    String
    Description

    Returns the elements that come before the specified cursor.

  • Name
    first
    Type
    Int
    Description

    Returns up to the first n elements from the list.

  • Name
    last
    Type
    Int
    Description

    Returns up to the last n elements from the list.

Returns

  • Name
    PageHistory.*
    Type
    PageHistory
    Description

    Any requested field from the PageHistory object.

Request

import { PackClient } from '@pack/client'
const packClient = new PackClient({
  token: 'YOUR-PACK-TOKEN'
});
const query = `
query PageHistory($id: ID!) {
  pageHistory(id: $id) {
    nodes {
      title
      handle
    }
  }
}
`;
const response = await packClient.fetch(query, { variables: { id: '0190e0f1-56ce-7057-b325-31ab648e58cb' } });
console.log(response.data);

Response

{
  "data": {
      "pageHistory": {
          "nodes": [
              {
                  "title": "Testing Page",
                  "handle": "testing-page"
              }
          ]
      }
  }
}

Was this page helpful?