Back to Content Management API

siteSettingsUpdate

Updates the site settings.

Arguments

  • Name
    input
    Type
    SiteSettingsUpdateInput!
    Description

    An object.

    • settings: JSON!
    • seo: JSON
    • favicon: String

Returns

Request

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

const query = `
  mutation SiteSettingsUpdate($input: SiteSettingsUpdateInput!) {
    siteSettingsUpdate(input: $input) {
      settings
      seo
      favicon
    }
  }
`;

const variables = {
  input: {
    settings: {
      title: 'My Site',
      description: 'My site description',
      logo: 'https://example.com/logo.png',
      primaryColor: '#000000',
      secondaryColor: '#FFFFFF',
      accentColor: '#FF0000',
      footer: 'My site footer',
      social: {
        facebook: 'https://facebook.com',
        twitter: 'https://twitter.com',
        linkedin: 'https://linkedin.com',
        instagram: 'https://instagram.com',
        youtube: 'https://youtube.com',
      },
    },
    seo: {
      title: 'My Site',
      description: 'My site description',
      keywords: 'site, description',
      image: 'https://example.com/image.png',
    },
    favicon: 'https://example.com/favicon.ico',
  },
};


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

Response

{
  "data": {
    "siteSettingsUpdate": {
      "settings": {
        "title": "My Site",
        "description": "My site description",
        "logo": "https://example.com/logo.png",
        "primaryColor": "#000000",
        "secondaryColor": "#FFFFFF",
        "accentColor": "#FF0000",
        "footer": "My site footer",
        "social": {
          "facebook": "https://facebook.com",
          "twitter": "https://twitter.com",
          "linkedin": "https://linkedin.com",
          "instagram": "https://instagram.com",
          "youtube": "https://youtube.com"
        }
      },
      "seo": {
        "title": "My Site",
        "description": "My site description",
        "keywords": "site, description",
        "image": "https://example.com/image.png"
      },
      "favicon": "https://example.com/favicon.ico"
    }
  }
}

Was this page helpful?