Skip to content

InputBuilder

Declares the input of an operation, Event or transition as a set of named values.

Every value is optional until mandatory() is called on its builder. Generated TypeScript types mirror the declaration, so handlers receive parsed and typed input.

Declaring the input of a Mutation

archive.input.addProperty('id', 'id').mandatory();
bulkVerify.input.addArray('ids').mandatory().property('id');
getItems.input.addJson('filter', zItemFilter.optional());

MutationBuilder.input and QueryBuilder.input

addArray(key): ArrayInputBuilder

Declares an array value; declare its element type on the returned builder.

string

Input key.

ArrayInputBuilder


addJson(key, parser): JsonInputBuilder

Declares a JSON value parsed by a Zod type or parse function.

string

Input key.

ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | JsonParse<any>

Zod type or parse function that parses the value.

JsonInputBuilder


addObject(key): ObjectInputBuilder

Declares a nested object value; declare its members on the returned builder.

string

Input key.

ObjectInputBuilder


addProperty(key, type): DataTypeInputBuilder

Declares a primitive or temporal value such as 'id', 'string' or 'date'.

string

Input key.

PrimitiveDataType | TemporalDataType

Data type of the value.

DataTypeInputBuilder

addProperty(key, type, options?): SelectInputBuilder

Declares a single-select or multi-select value; declare its options on the returned builder, or resolve them from a well-known format via options.format.

string

Input key.

SelectDataType

Select data type.

SelectInputOptions

Select options, such as the format the options are resolved from.

SelectInputBuilder

addProperty(key, type): JsonInputBuilder

Declares a JSON value parsed by a Zod type.

string

Input key.

ZodType

Zod type of the value.

JsonInputBuilder

addProperty(key, type, options?): JsonInputBuilder

Declares a value of any supported type and returns the matching builder.

string

Input key.

PrimitiveDataType | TemporalDataType | SelectDataType | ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

Data type name or Zod type.

SelectInputOptions

Select options, only applicable to a select data type.

JsonInputBuilder


toDefinition(): InputDefinition

Emits the input Definition, or null when no values are declared.

InputDefinition