Mutate

class Mutate<T, S>(key: MutationKey<T, S>, variable: S, revision: String, marker: Marker = Marker.None, callback: MutationCallback<T>? = null) : MutationCommand<T>

Executes the mutate function of the specified MutationKey.

Note: The mutation is not executed if the revision is different.

Parameters

key

Instance of a class implementing MutationKey.

variable

The variable to be mutated.

revision

The revision of the mutation state.

marker

The marker with additional information based on the caller of a mutation.

callback

The callback to receive the result of the mutation.

Constructors

Link copied to clipboard
constructor(key: MutationKey<T, S>, variable: S, revision: String, marker: Marker = Marker.None, callback: MutationCallback<T>? = null)

Functions

Link copied to clipboard
open suspend override fun handle(ctx: MutationCommand.Context<T>)

Handles the mutation.