Back to Content Management API

productPageRevision

Returns a product page's revision.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the product 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 ProductPageRevision($id: ID!, $revisionId: ID!) {
  productPageRevision(id: $id, revisionId: $revisionId) {
    title
    handle
    description
  }
}
`
const variables = {
  id: 'product-page-id',
  revisionId: 'revision-id'
}
const response = await packClient.fetch(query, { variables: variables });
console.log(response.data);

Response

{
    "data": {
        "productPageRevision": {
            "title": "Product Title",
            "handle": "product-handle",
            "description": "Product Description"
        }
    }
}

Was this page helpful?