Type Alias EditAction

EditAction: {
    actionType: "sanity.action.document.edit";
    draftId: string;
    patch: PatchOperations;
    publishedId: string;
}

Modifies an existing draft document. If no draft exists, creates one from published version.

Type declaration

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

    Draft document ID to edit

  • patch: PatchOperations

    Patch operations to apply

  • publishedId: string

    Published document ID to base draft on

await client.action({
actionType: 'sanity.action.document.edit',
draftId: 'drafts.bike-123',
publishedId: 'bike-123',
patch: {set: {inStock: false}}
})