Back to Content Management API
sectionRevision
Returns a section's revision.
Arguments
- Name
id
- Type
- ID!
- Description
The ID of the section.
- Name
revisionId
- Type
- ID!
- Description
The ID of the revision.
Returns
- Name
Section.*
- Type
- Section
- Description
Any requested field from the Section object.
Request
import { PackClient } from '@pack/client'
const packClient = new PackClient({
token: 'YOUR-PACK-TOKEN'
});
const query = `
query SectionRevision($id: ID!, $revisionId: ID!) {
sectionRevision(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": {
"sectionRevision": {
"title": "Section Title",
"handle": "section-title",
"description": "Section Description"
}
}
}