MutationRef

interface MutationRef<T, S> : Actor

A reference to a Mutation for MutationKey.

Parameters

T

Type of the return value from the mutation.

S

Type of the variable to be mutated.

Properties

Link copied to clipboard
abstract val key: MutationKey<T, S>

The MutationKey for the Mutation.

Link copied to clipboard
abstract val marker: Marker

The Marker specified in MutationClient.getMutation.

Link copied to clipboard
abstract val options: MutationOptions

The MutationOptions configured for the mutation.

Link copied to clipboard
abstract val state: StateFlow<MutationState<T>>

State Flow to receive the current state of the mutation.

Functions

Link copied to clipboard
abstract fun launchIn(scope: CoroutineScope): Job

Launches the actor.

Link copied to clipboard
open suspend fun mutate(variable: S): T

Mutates the variable.

Link copied to clipboard
open suspend fun mutateAsync(variable: S)

Mutates the variable asynchronously.

Link copied to clipboard
open suspend fun reset()

Resets the mutation state.

Link copied to clipboard
abstract suspend fun send(command: MutationCommand<T>)

Sends a MutationCommand to the Actor.