#[non_exhaustive]pub struct MutationExecution {
pub data: Value,
pub outcome: MutationOutcome,
}Expand description
Core mutation execution logic.
Called from:
MutationRunner::execute_mutation— the typed entries a non-GraphQL transport usesExecutor::execute_mutation_query— raw GraphQL dispatchexecute_with_security_internal— authenticated GraphQL dispatch
The caller is not responsible for establishing write capability. It used to be,
by one of two means — a SupportsMutations bound or a supports_mutations() guard —
and the first caller above met it with the bound, which speaks only for the marker.
Step 0 below resolves the executor’s write handle — present exactly when a constructor
bounded on Writer built it — and that handle is the only way to reach the database
from here.
§Errors
FraiseQLError::Validation— mutation not found, nosql_source, missing security context forinjectparams, or database function returned no rows.FraiseQLError::Database— the adapter’sexecute_writefailed.
response_key is the key the result appears under in data — the document’s
alias when it has one, otherwise mutation_name. Two roots calling the same
mutation are told apart only by it.
What a mutation produced: the GraphQL-shaped response and the parsed
mutation_response envelope (#1330).
A GraphQL client reads the projection; a transport whose own wire format is
the envelope — gRPC’s MutationResponse{success, id, error} — needs
entity_id and the failure message, and the projection cannot carry them: on
success it holds the entity, whose id is the row’s, not the envelope’s, and
on failure it holds only the error class. Consuming the envelope and discarding
it is what forced gRPC to call the database directly in the first place.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.data: ValueThe {"data": {...}} envelope, projected by the selection set.
outcome: MutationOutcomeThe parsed app.mutation_response row this write produced.