Skip to content

MutationHandler

MutationHandler<TInput, TOutput, TCurrent, TContext> = (input, current, ctx) => Promise<TOutput>

Performs the write behavior of a Mutation and returns a result for the Runtime to marshal against the output declaration.

TInput = any

Parsed input shape; the compiler derives it from the input declaration.

TOutput = any

Result shape; the compiler derives it from the output declaration.

TCurrent = WriteAppInstance

App instance handed to the handler.

TContext = WriteRuntimeInstance

Runtime instance handed to the handler.

TInput

Input parsed against the Mutation’s input declaration.

TCurrent

The App that declared the Mutation, with write access to its Items.

TContext

Write Runtime bound to the Workspace of the call.

Promise<TOutput>

The result the Runtime checks against the output declaration.

Behavior and change