Return the net delta per resource for a task.
Every task->mutated->resource edge is rolled up server-side
into a per-resource net delta: create + many updates collapses to
a single create; create + delete collapses to a noop; etc.
The fields_changed list on each entry is the union of top-level
fields that differ between the earliest before and the latest
after snapshots.
The endpoint scans up to settings.MAX_GRAPH_DIFF_MUTATIONS
edges per request. Tasks with more mutations than the cap return
a partial rollup marked truncated=true — use the paginated
/mutations endpoint for the full audit trail.
Sensitive fields on the snapshots are masked by default. Pass
reveal=true to return actual values, matching the
/resources endpoint’s convention.
Returns:
GraphDiff with per-resource net deltas and the raw mutation
count.
Raises: NotFoundError: If task not found or belongs to another organization.
Reveal sensitive field values on before/after snapshots
Successful Response
Top-level graph diff response for a task.
Attributes:
task_id: Task SurrealDB record id part. Echoed back so clients
can correlate the response with the request.
resources: Net delta per affected resource. Ordered by
(resource_table, resource_id) for deterministic output.
total_mutations: Raw mutation edge count folded into the
rollup. When truncated is True this is the cap,
not the real total — the real total is not known without
a full scan.
total_mutations_scanned: Number of mutation edges actually
consumed from the database before the rollup was cut off.
Equals total_mutations in the common (non-truncated)
case. Exposed so clients can surface "5000 mutations
scanned" when truncated is True.
truncated: True when the task had more mutation edges than
the configured cap (settings.MAX_GRAPH_DIFF_MUTATIONS).
The rollup is still safe to display but does not reflect
every mutation. Clients should direct users to the
paginated /mutations endpoint for the full audit trail.
has_more: Alias for truncated — kept for clients that use
the has-more convention.