Class MutationResult<TVariables, TData>
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
Mutation handle returned by UseMutation<TVariables, TData>(MutationOptions<TVariables, TData>). Exposes Status flags + Data / Error / Variables snapshots + Mutate(TVariables) / MutateAsync(TVariables) / Reset() imperative API.
public sealed class MutationResult<TVariables, TData>
Type Parameters
TVariablesTData
- Inheritance
-
objectMutationResult<TVariables, TData>
Properties
- Data
Result of the last successful mutation, or default when none has succeeded.
- Error
Exception from the last failed mutation, or null.
- IsError
True when the last mutation threw.
- IsIdle
True when no mutation has run yet (or it was reset).
- IsPending
True while a mutation is in flight.
- IsSuccess
True when the last mutation completed successfully.
- Status
Current lifecycle status of the mutation.
- Variables
Variables passed to the most recent mutation invocation, or default.
Methods
- Mutate(TVariables)
Fire-and-forget mutation that does not return a task.
- MutateAsync(TVariables)
Awaitable mutation. Rethrows the underlying exception on failure so callers can
try/catch; Error is also populated.