MutationHandlerInstance
Exposes a Mutation on an App so that application code can invoke it with the same Grant checks, input parsing, and output marshalling the platform applies.
Remarks
Section titled “Remarks”Calling handler asserts the Mutation’s Grants against the active context, parses the input
against the declared input definition, runs the application handler, and marshals its result
against the declared output. Reach a Mutation through ctx.apps.<app>.mutations.<key> inside
a write execution.
Example
Section titled “Example”Invoking a Mutation from a write execution
const company = await instance.execute('readwrite', { payload: {}, traceId }, async (ctx) => { return await ctx.apps.hris.mutations.createCompany.handler({ code, title: `Company ${code}` }, ctx.apps.hris, ctx);});- MutationHandler
- WriteAppInstance.mutations
- MutationBuilder for declaring a Mutation
Properties
Section titled “Properties”definition
Section titled “definition”
readonlydefinition:MutationDefinition
The compiled definition the handler was created from, including its Grants, input, and output.
handler
Section titled “handler”
readonlyhandler:MutationHandler
Invokes the Mutation with (input, current, ctx), applying Grant checks and input and output marshalling.
readonlyprn:string
PRN identifying this Mutation within the definition.

