Back to Content Management API
articleRevision
Returns an article's revision.
Arguments
- Name
id
- Type
- ID!
- Description
The ID of the article.
- Name
revisionId
- Type
- ID!
- Description
The ID of the revision.
Returns
- Name
Article.*
- Type
- Article
- Description
Any requested field from the Article object.
Request
import { PackClient } from '@pack/client'
const packClient = new PackClient({
token: 'YOUR-PACK-TOKEN'
});
const query = `
query ArticleRevision($id: ID!, $revisionId: ID!) {
articleRevision(id: $id, revisionId: $revisionId) {
title
handle
description
}
}
`
const variables = {
id: 'article-id',
revisionId: 'revision-id'
}
const response = await packClient.fetch(query, { variables: variables });
console.log(response.data);
Response
{
"data": {
"articleRevision": {
"title": "Article Title",
"handle": "article-handle",
"description": "Article description."
}
}
}