Back to Content Management API

schedulePublish

Publishes a schedule.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The ID of the schedule you want to publish.

Returns

  • Name
    Schedule.*
    Type
    Schedule
    Description

    Any requested field from the Schedule object.

Request

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

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

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

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

Response

{
  "data": {
    "schedulePublish": {
      "id": "YOUR-SCHEDULE-ID",
      "name": "Schedule Name",
      "status": "PUBLISHED"
    }
  }
}

Was this page helpful?