Back to Content Management API
sectionUnpublish
Unpublishes section.
Arguments
- Name
id
- Type
- ID!
- Description
The ID of the section you want to unpublish.
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 sectionUnpublish($id: ID!) {
sectionUnpublish(id: $id) {
id
name
status
}
}
`;
const variables = {
id: 'YOUR-SECTION-ID'
};
const response = await packClient.fetch(query, { variables: variables });
console.log(response.data);
Response
{
"data": {
"sectionUnpublish": {
"id": "YOUR-SECTION-ID",
"name": "YOUR-SECTION-NAME",
"status": "UNPUBLISHED"
}
}
}