Skip to content

MutationBuilder

Configures a Mutation: a deliberate write operation with declared input, output and Grants.

A Mutation is the entry point for work that changes Items. The type parameters carry the generated input, output, App and context types so that generated Mutation builders stay assignable to this interface.

_TInput = any

Parsed input type of the handler.

_TOutput = any

Result type of the handler.

_TCurrent = WriteAppInstance

App instance type handed to the handler.

_TContext = WriteRuntimeInstance

Write context type handed to the handler.

readonly input: InputBuilder

Input declaration; add values with addProperty, addArray, addObject or addJson.


readonly output: OutputBuilder

Result declaration; select the shape with item, value, object, template or void.


readonly prn: string

Platform Resource Name of the declared resource, derived from the App key and resource key.

BaseOperationBuilder.prn

addGrant(role): OperationGrant

Grants a Role permission to call this operation.

BaseRoleBuilder

Role permitted to call the operation.

OperationGrant

The Grant builder.

The Grant only permits the call. Inside the handler, Item and Property access is still checked against the caller’s Roles and Grants.

Granting a Mutation to administrators

closePayRun.addGrant(core.roles.admin);

Grant access

BaseOperationBuilder.addGrant


setDescription(description): this

Sets the description emitted into the definition and rendered in generated reference and application assets.

string

Human-readable description of the resource.

this

This builder for chaining.

BaseOperationBuilder.setDescription


toDefinition(): MutationDefinition

Emits the Definition of this Mutation, including its handler.

MutationDefinition