QueryBuilder
Configures a Query: a read-only operation with declared input, output and Grants.
Remarks
Section titled “Remarks”A Grant on the Query permits the call; Item and Property access inside the handler is still checked against the caller. The type parameters carry the generated input, output, App and context types so that generated Query builders stay assignable to this interface.
- AppBuilder.addQuery
- Behavior and change
- QueryDefinition for the emitted Definition
- QueryHandlerInstance for invoking the Query inside an execution
Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”_TInput
Section titled “_TInput”_TInput = any
Parsed input type of the handler.
_TOutput
Section titled “_TOutput”_TOutput = any
Result type of the handler.
_TCurrent
Section titled “_TCurrent”_TCurrent = ReadAppInstance
App instance type handed to the handler.
_TContext
Section titled “_TContext”_TContext = ReadRuntimeInstance
Read context type handed to the handler.
Properties
Section titled “Properties”
readonlyinput:InputBuilder
Input declaration; add values with addProperty, addArray, addObject or addJson.
output
Section titled “output”
readonlyoutput:OutputBuilder
Result declaration; select the shape with item, value, object, template or void.
readonlyprn:string
Platform Resource Name of the declared resource, derived from the App key and resource key.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”addGrant()
Section titled “addGrant()”addGrant(
role):OperationGrant
Grants a Role permission to call this operation.
Parameters
Section titled “Parameters”Role permitted to call the operation.
Returns
Section titled “Returns”The Grant builder.
Remarks
Section titled “Remarks”The Grant only permits the call. Inside the handler, Item and Property access is still checked against the caller’s Roles and Grants.
Example
Section titled “Example”Granting a Mutation to administrators
closePayRun.addGrant(core.roles.admin);Inherited from
Section titled “Inherited from”setDescription()
Section titled “setDescription()”setDescription(
description):this
Sets the description emitted into the definition and rendered in generated reference and application assets.
Parameters
Section titled “Parameters”description
Section titled “description”string
Human-readable description of the resource.
Returns
Section titled “Returns”this
This builder for chaining.
Inherited from
Section titled “Inherited from”BaseOperationBuilder.setDescription
setMethod()
Section titled “setMethod()”setMethod(
next):this
Sets the HTTP method the Query is served on; GET by default. Use POST when the input
can outgrow a URL, as the query string is size-limited (by the WAF and load balancer).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
toDefinition()
Section titled “toDefinition()”toDefinition():
QueryDefinition
Emits the Definition of this Query, including its handler.

