Update draft content

updateDraftContent(input: UpdateDraftContentInput!): UpdateDraftContentPayload!

Requires project.files.write.

Arguments

ArgumentTypeRequired
inputUpdateDraftContentInput!Yes

Input fields

input

UpdateDraftContentInput

FieldTypeRequiredDescription
projectReferenceStringNo
entityIdID!YesExisting source-file path or UUID whose pending full-body draft is replaced.
entityTypeDraftEntityType!YesMust match the existing source-file type.
branchIdIDNo
bodyString!YesEmpty bodies are valid. Saves a durable draft and repairs Yjs state without creating an immutable version.
branchReferenceStringNoBranch name or UUID; equivalent branchId aliases are accepted, conflicting ones rejected. Omit/null for main.
expectedDraftVersionIntNoExpected current draft sequence (0 means no prior draft), not a committed-file version ID. Omit/null for unconditional replacement; stale values are concurrency errors409.

Response

Returns UpdateDraftContentPayload!. Open the type for its fields and nested types.

FieldTypeDescription
entityIdID!
entityTypeDraftEntityType!
bodyString!
versionInt!Current draft sequence; identical bodies retain the sequence.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

query.graphql
mutation UpdateDraftContent($input: UpdateDraftContentInput!) {  updateDraftContent(input: $input) {    body    entityId    entityType    version  }}
variables.json
{  "input": {    "projectReference": "00000000-0000-4000-8000-000000000001",    "entityId": "00000000-0000-4000-8000-000000000001",    "entityType": "page",    "body": "example"  }}