Modifies an existing draft document. If no draft exists, creates one from published version.
Draft document ID to edit
Patch operations to apply
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}}}) Copy
await client.action({ actionType: 'sanity.action.document.edit', draftId: 'drafts.bike-123', publishedId: 'bike-123', patch: {set: {inStock: false}}})
Modifies an existing draft document. If no draft exists, creates one from published version.