Skip to main content

WasmModuleTrigger

A trigger binding on a compute module: a tick loop, a model/compute event subscription, or a client-invokable export.

type WasmModuleTrigger {
triggerId: String!
appId: BigInt!
moduleId: String!
triggerType: String!
tickHz: Float
onEvent: String
functionName: String
containerTypeName: String
propertyKey: String
eventName: String
debounceMs: Int!
exportName: String
invokePolicyJson: String
contractJson: String
createdAt: DateTime!
}

Fields

WasmModuleTrigger.triggerId ● String! non-null scalar

Unique trigger id (UUID).

WasmModuleTrigger.appId ● BigInt! non-null scalar

The app (tenant).

WasmModuleTrigger.moduleId ● String! non-null scalar

The module this trigger drives.

WasmModuleTrigger.triggerType ● String! non-null scalar

Trigger type: tick | event | invoke.

WasmModuleTrigger.tickHz ● Float scalar

For tick triggers: the tick rate in Hz. The module ticks at this rate only while its app has a player connected somewhere in the fleet, and stops when the last one leaves.

WasmModuleTrigger.onEvent ● String scalar

For event triggers: function_invoked | property_changed | container_created | compute_event | player_left | player_joined. player_left (v1.87.0) is delivered to on_event as JSON with event, actor_uuid, user_id, chunk_x/y/z, last_seen_at, left_reason and remaining_player_count, once per actor that stops being present, the last one included. player_joined (v1.93.0) is delivered with actor_uuid, user_id, chunk_x/y/z, first_seen_at and current_player_count.

WasmModuleTrigger.functionName ● String scalar

Event filter: only this model function name.

WasmModuleTrigger.containerTypeName ● String scalar

Event filter: only this container type.

WasmModuleTrigger.propertyKey ● String scalar

Event filter: only this property key.

WasmModuleTrigger.eventName ● String scalar

Event filter: only compute events with this name.

WasmModuleTrigger.debounceMs ● Int! non-null scalar

Debounce/coalesce window in ms.

WasmModuleTrigger.exportName ● String scalar

For invoke triggers: the exported guest function name.

WasmModuleTrigger.invokePolicyJson ● String scalar

For invoke triggers: JSON authority tree gating who may invoke. Null = app admins only.

WasmModuleTrigger.contractJson ● String scalar

For invoke triggers: the typed contract (JSON: params/result field maps with int|float|string|bool|object|array types). The platform validates computeInvoke params against it pre-sandbox; client codegen reads it for typed wrappers. Null = undeclared.

WasmModuleTrigger.createdAt ● DateTime! non-null scalar

When the trigger was created.

Returned By

computeModuleTriggers query ● computeUpsertTrigger mutation