Table of Contents

Class MutationResult<TVariables, TData>

Namespace
Velvet
Assembly
Velvet.Docs.dll
public sealed class MutationResult<TVariables, TData>

Type Parameters

TVariables
TData
Inheritance
object
MutationResult<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.

Reset()

Resets status to Idle and clears Data / Error / Variables. In-flight mutations are not cancelled by Reset.