Back to Content Management API

blogRestore

Restores a blog to a specific revision.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the blog you want to restore.

  • Name
    revisionId
    Type
    ID!
    Description

    The ID of the revision you want to use to restore.

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 = `
  mutation BlogRestore($id: ID!, $revisionId: ID!) {
    blogRestore(id: $id, revisionId: $revisionId) {
      id
      title
      handle
      description
    }
  }
`;

const variables = {
  id: 'YOUR-BLOG-ID',
  revisionId: 'YOUR-REVISION-ID'
};

const response = await packClient.fetch(query, { variables: variables });
console.log(response.data);

Response

{
  "data": {
    "blogRestore": {
      "id": "60f4b3b3b3b3b3b3b3b3b3b",
      "title": "Blog Title",
      "handle": "blog-title",
      "description": "Blog Description"
    }
  }
}

Was this page helpful?