Skip to content

OutputBuilder

Declares the result shape of a Mutation or Query.

Call one of item, relatedItem, object, template, value or void; a subsequent call replaces the earlier declaration. The declaration drives the generated result type and how the Runtime marshals the handler’s return value. An operation with no declaration returns nothing.

Common result shapes

archive.output.item(automation).mandatory();
listGroups.output.item(employeeGroup).cursor();
runLeaveExpiryJob.output.value('boolean').mandatory();
republish.output.void();

MutationBuilder.output and QueryBuilder.output

readonly prn: string

Platform Resource Name of the output.

item(templateOrUnion): ItemOutputBuilder

Declares that the result is an Item of one of the given Templates or Unions.

OutputBuilderItemType | OutputBuilderItemType[]

Template, Union, or several of them, whose Items may be returned.

ItemOutputBuilder

The Item output builder.

Union membership is resolved when the Definition is built, so members added after this call are included. Chain array(), cursor() or page() to return several Items.

When no Template or Union is given, or a value is not a Template or Union builder.


object(): ObjectInputBuilder

Declares that the result is an object; declare its members on the returned builder.

ObjectInputBuilder

The object builder for the result’s members.


relatedItem(templateOrUnion): ItemOutputBuilder

Declares that the result is a related Item: the target Item together with the metadata of the Relation it was reached through.

OutputBuilderItemType | OutputBuilderItemType[]

Template, Union, or several of them, whose Items may be returned.

ItemOutputBuilder

The Item output builder.

When no Template or Union is given, or a value is not a Template or Union builder.

Relate items


template(): TemplateOutputBuilder

Declares that the result is a Template Definition.

TemplateOutputBuilder

The Template output builder.


toDefinition(): OutputDefinition

Emits the output Definition, or null when the operation returns nothing.

OutputDefinition


value(value): DataValueOutputBuilder

Declares that the result is a single value of the given data type, such as 'boolean'.

DataType

Data type of the result.

DataValueOutputBuilder

The value output builder.


void(): this

Declares that the operation returns nothing.

this

This builder for chaining.