Back to Content Management API
scheduleClear
Clears a schedule's executeAt and timezone and resets its state to created, so it no longer runs. The schedule and its content are kept.
Arguments
- Name
id- Type
- ID!
- Description
The ID of the schedule.
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 ScheduleClear($id: ID!) {
scheduleClear(id: $id) {
id
executeAt
state
}
}
`
const variables = {
id: 'schedule-id',
}
const response = await packClient.fetch(query, { variables })
console.log(response.data)
Response
{
"data": {
"scheduleClear": {
"id": "schedule-id",
"executeAt": null,
"state": "created"
}
}
}