Replaces an existing draft document. At least one of draft or published versions must exist.
Document to create. Must have _id and _type
_id
_type
Published document ID to base draft on
await client.action({ actionType: 'sanity.action.document.replaceDraft', publishedId: 'bike-123', attributes: { _id: 'drafts.bike-123', _type: 'bike', name: 'Updated Bike' }}) Copy
await client.action({ actionType: 'sanity.action.document.replaceDraft', publishedId: 'bike-123', attributes: { _id: 'drafts.bike-123', _type: 'bike', name: 'Updated Bike' }})
Replaces an existing draft document. At least one of draft or published versions must exist.