Back to Content Management API

templateUnpublish

Unpublishes a template.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the template you want to unpublish.

Returns

  • Name
    Template.*
    Type
    Template
    Description

    Any requested field from the Template object.

Request

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

const query = `
  mutation templateUnpublish($id: ID!) {
    templateUnpublish(id: $id) {
      id
      name
      status
    }
  }
`;

const variables = {
  id: 'YOUR-TEMPLATE-ID'
};

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

Response

{
  "data": {
    "templateUnpublish": {
      "id": "TEMPLATE_ID",
      "name": "TEMPLATE_NAME",
      "status": "UNPUBLISHED"
    }
  }
}

Was this page helpful?