OutputBuilder
Declares the result shape of a Mutation or Query.
Remarks
Section titled “Remarks”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.
Example
Section titled “Example”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
Properties
Section titled “Properties”
readonlyprn:string
Platform Resource Name of the output.
Methods
Section titled “Methods”item()
Section titled “item()”item(
templateOrUnion):ItemOutputBuilder
Declares that the result is an Item of one of the given Templates or Unions.
Parameters
Section titled “Parameters”templateOrUnion
Section titled “templateOrUnion”OutputBuilderItemType | OutputBuilderItemType[]
Template, Union, or several of them, whose Items may be returned.
Returns
Section titled “Returns”The Item output builder.
Remarks
Section titled “Remarks”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.
Throws
Section titled “Throws”When no Template or Union is given, or a value is not a Template or Union builder.
object()
Section titled “object()”object():
ObjectInputBuilder
Declares that the result is an object; declare its members on the returned builder.
Returns
Section titled “Returns”The object builder for the result’s members.
relatedItem()
Section titled “relatedItem()”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.
Parameters
Section titled “Parameters”templateOrUnion
Section titled “templateOrUnion”OutputBuilderItemType | OutputBuilderItemType[]
Template, Union, or several of them, whose Items may be returned.
Returns
Section titled “Returns”The Item output builder.
Throws
Section titled “Throws”When no Template or Union is given, or a value is not a Template or Union builder.
template()
Section titled “template()”template():
TemplateOutputBuilder
Declares that the result is a Template Definition.
Returns
Section titled “Returns”The Template output builder.
toDefinition()
Section titled “toDefinition()”toDefinition():
OutputDefinition
Emits the output Definition, or null when the operation returns nothing.
Returns
Section titled “Returns”value()
Section titled “value()”value(
value):DataValueOutputBuilder
Declares that the result is a single value of the given data type, such as 'boolean'.
Parameters
Section titled “Parameters”Data type of the result.
Returns
Section titled “Returns”The value output builder.
void()
Section titled “void()”void():
this
Declares that the operation returns nothing.
Returns
Section titled “Returns”this
This builder for chaining.

