POST /revisions/:id/data/command (Command: apply_session_graph_mutations)
Mutations are applied atomically in the order listed. Optimistic concurrency is supported per element
via if_rev.
Request Body
Mutation Operation Types
Each entry inoperations is an object with an op discriminator and op-specific fields:
add_vertex requires a non-empty labels list. Labels are set only at creation and are immutable afterward, so there
are no label-mutation operations (set_labels, add_labels, remove_labels do not exist).
Every operation may optionally include if_rev (integer). If present, the server checks that the
current rev of the element matches if_rev before applying the operation. A mismatch aborts the
entire batch and returns graph_mutation_conflict (409).
Response
Errors
invalid_graph_envelope— the alias does not exist or itsvalue.typeis not"graph".invalid_vertex_labels— anadd_vertexop omittedlabelsor supplied only empty/whitespace labels; a vertex must be created with at least one non-empty label.graph_element_too_large— a single element, serialized, reachesworkflow.graph_element_bytes, 65,536 bytes (64 KiB). The body carrieslimit.graph_mutation_too_large— the call carries more operations thanworkflow.graph_mutations_per_callallows, 40, and the body’slimitnames it; or its operations expand into more writes than one transaction can apply; or two of its operations act on one element in conflicting ways, such as creating and deleting it.graph_mutation_conflict(409) — anif_revcheck failed; the batch was not applied.
Example
See also
- Graph session object — envelope shape and element schema.
- Query Session Graph — traverse the graph with a query AST.
- List Session Graph Elements — paginate all elements.
- List Session Graph Neighbors — fetch neighbors of a set of vertices.
- Get Session Graph Element — fetch a single element.
- Get Session Graph Elements — fetch multiple elements by id.
graph.changedevent — raised after each mutation batch, with the graph’saliasin itsobjectblock and the batch’schanges.

