Back to Content Management API

collectionPageRevision

Returns a collection page's revision.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the collection page.

  • Name
    revisionId
    Type
    ID!
    Description

    The ID of the revision.

Returns

Request

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

const query = `
query CollectionPageRevision($id: ID!, $revisionId: ID!) {
  collectionPageRevision(id: $id, revisionId: $revisionId) {
    title
    handle
    description
  }
}
`
const variables = {
  id: 'collection-page-id',
  revisionId: 'revision-id'
}
const response = await packClient.fetch(query, { variables: variables });
console.log(response.data);

Response

{
  "data": {
    "collectionPageRevision": {
      "title": "Collection Page Title",
      "handle": "collection-page-title",
      "description": "Collection Page Description"
    }
  }
}

Was this page helpful?