Back to Content Management API

productPageUnpublish

Unpublishes product page.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the product page you want to unpublish.

Returns

  • Name
    ProductPage.*
    Type
    ProductPage
    Description

    Any requested field from the Productpage object.

Request

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

const query = `
  mutation ProductPageUnpublish($id: ID!) {
    productPageUnpublish(id: $id) {
      id
      title
      handle
      description
    }
  }
`;

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

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

Response

{
  "data": {
    "productPageUnpublish": {
      "id": "1",
      "title": "Product Page Title",
      "handle": "product-page-title",
      "description": "Product Page Description"
    }
  }
}

Was this page helpful?