Back to Content Management API

siteSettingsRestore

Restores the site settings to a specific revision.

Arguments

  • Name
    revisionId
    Type
    ID!
    Description

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

Returns

Request

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

const query = `
  mutation siteSettingsRestore($revisionId: ID!) {
    siteSettingsRestore(revisionId: $revisionId) {
      id
      title
      description
      logo {
        url
      }
      favicon {
        url
      }
      theme {
        primaryColor
        secondaryColor
        backgroundColor
        textColor
      }
      socialLinks {
        name
        url
      }
      meta {
        title
        description
        keywords
      }
      createdAt
      updatedAt
    }
  }
`;
const variables = {
  revisionId: 'REVISION_ID'
};

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

Response

{
  "data": {
    "siteSettingsRestore": {
      "id": "SITE_SETTINGS_ID",
      "title": "Site Title",
      "description": "Site Description",
      "logo": {
        "url": "https://example.com/logo.png"
      },
      "favicon": {
        "url": "https://example.com/favicon.png"
      },
      "theme": {
        "primaryColor": "#000000",
        "secondaryColor": "#000000",
        "backgroundColor": "#000000",
        "textColor": "#000000"
      },
      "socialLinks": [
        {
          "name": "Facebook",
          "url": "https://facebook.com"
        }
      ],
      "meta": {
        "title": "Meta Title",
        "description": "Meta Description",
        "keywords": "Meta Keywords"
      },
      "createdAt": "2022-01-01T00:00:00.000Z",
      "updatedAt": "2022-01-01T00:00:00.000Z"
    }
  }
}

Was this page helpful?