Back to Content Management API

blogRevision

Returns a blog's revision.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the blog.

  • Name
    revisionId
    Type
    ID!
    Description

    The ID of the revision.

Returns

  • Name
    Blog.*
    Type
    Blog
    Description

    Any requested field from the Blog object.

Request

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

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

Response

{
    "data": {
        "blogRevision": {
            "title": "Blog Title",
            "handle": "blog-handle",
            "description": "Blog Description"
        }
    }
}

Was this page helpful?