activeMutations property

Map<String, MutationUpdate> get activeMutations

Snapshot of all currently running (pending) mutations, keyed by controller ID.

An entry is added when a MutationController transitions to MutationPending and is automatically purged as soon as the mutation finishes (MutationSuccess or MutationFailure). Controllers that reset to MutationIdle or are disposed are also removed.

This means activeMutations never accumulates "ghost" entries for completed mutations. For completed events, subscribe to mutationEvents.

Use this on DevTools connect to see what is currently in-flight: then subscribe to mutationEvents for real-time state changes.

// On DevTools connect: read pending snapshot, then subscribe to stream.
final pending = client.activeMutations;
client.mutationEvents.listen((event) { ... });

Implementation

Map<String, MutationUpdate> get activeMutations =>
    Map.unmodifiable(_activeMutations);