Back to Content Management API
productPageHistory
Returns array of all revisions for the product page by ID paginated by a cursor.
Arguments
- Name
id
- Type
- ID!
- Description
The ID of the product 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
ProductPageRevisionConnection.edges
- Type
- [ProductPageEdge!]!
- Description
A list of edges.
- Name
ProductPageRevisionConnection.nodes
- Type
- [ProductPageRevision!]!
- Description
A list of the nodes contained in ProductPageRevisionEdge.
- Name
ProductPageRevisionConnection.pageInfo
- Type
- PageInfo!
- Description
Information to aid in pagination.
- Name
ProductPageRevisionConnection.totalCount
- Type
- Int
- Description
The total count of items.
Request
import { PackClient } from '@pack/client'
const packClient = new PackClient({
token: 'YOUR-PACK-TOKEN'
});
const query = `
query ProductPageHistory($id: ID!) {
productPageHistory(id: $id) {
nodes {
title
handle
description
}
}
}
`;
const variables = {
id: 'product-page-id',
}
const response = await packClient.fetch(query, { variables: variables });
console.log(response.data);
Response
{
"data": {
"productPageHistory": {
"nodes": [
{
"title": "Product Title",
"handle": "product-handle",
"description": "Product Description"
}
]
}
}
}