Type Alias DiscardAction

DiscardAction: {
    actionType: "sanity.action.document.discard";
    draftId: string;
    purge?: boolean;
}

Deletes a draft document. Fails if draft doesn't exist. Can optionally purge document history.

Type declaration

  • actionType: "sanity.action.document.discard"
  • draftId: string

    Draft document ID to delete

  • Optionalpurge?: boolean

    Whether to delete document history

await client.action({
actionType: 'sanity.action.document.discard',
draftId: 'drafts.bike-123',
purge: false
})