Back to Content Management API

sectionRestore

Restores a section to a specific revision.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the section you want to restore.

  • Name
    revisionId
    Type
    ID!
    Description

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

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 = `
  mutation sectionRestore($id: ID!, $revisionId: ID!) {
    sectionRestore(id: $id, revisionId: $revisionId) {
      id
      name
      status
    }
  }
`;

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

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

Response

{
  "data": {
    "sectionRestore": {
      "id": "SECTION_ID",
      "name": "SECTION_NAME",
      "status": "SECTION_STATUS"
    }
  }
}

Was this page helpful?