| method | Description | Example |
|---|---|---|
| resolveField(ReturnType) | Calculates a resolved field declared in the constant model. The parent document is passed to exec by default. | |
| interval(ms) | Runs a recurring server task every given number of milliseconds. | |
| cron(expression) | Runs scheduled work with a cron expression. Commonly used with serverMode options for batch jobs. | |
| initialize(options?) / destroy(options?) | Runs setup or teardown logic when the server process starts or stops. | |
| process(ReturnType) | Defines a background queue job. Use msg(...) to describe the job payload. | |
Calculates a resolved field declared in the constant model. The parent document is passed to exec by default.
Runs a recurring server task every given number of milliseconds.
Runs scheduled work with a cron expression. Commonly used with serverMode options for batch jobs.
Runs setup or teardown logic when the server process starts or stops.
Defines a background queue job. Use msg(...) to describe the job payload.
| method | Description | Example |
|---|---|---|
| query(ReturnType, options?) | Read API. Use it for loading one model, computed data, or public files. | |
| mutation(ReturnType, options?) | Write API. Use it for create, update, delete, or business actions. | |
| message(ReturnType, options?) | WebSocket message handler. Use msg(...) for incoming payload fields. | |
| pubsub(ReturnType, options?) | Realtime subscription channel. Use room(...) to describe the subscription room. | |
Read API. Use it for loading one model, computed data, or public files.
Write API. Use it for create, update, delete, or business actions.
WebSocket message handler. Use msg(...) for incoming payload fields.
Realtime subscription channel. Use room(...) to describe the subscription room.
| field | Description | Example |
|---|---|---|
| .param(name, Type, options?) | Required path-style argument. Common in query, mutation, and slice list methods. | |
| .search(name, Type, options?) | Optional search/query argument. It is nullable by default. | |
| .body(name, Type, options?) | Request body value, commonly used by mutation APIs. | |
| .msg(name, Type, options?) | Message or process payload argument. | |
| .room(name, Type, options?) | Realtime room key for pubsub subscription channels. | |
| .with(InternalArg, options?) | Server-derived context such as Self, Req, Res, Ws, or custom internal args. | |
Required path-style argument. Common in query, mutation, and slice list methods.
Optional search/query argument. It is nullable by default.
Request body value, commonly used by mutation APIs.
Message or process payload argument.
| method | Description | Example |
|---|---|---|
| view[Model](id) | Fetch detail-view data generated from the model module. | |
| edit[Model](id) | Fetch edit-view data generated from the model module. | |
| merge[Model](id, data) | Create or update model data through the generated module API. | |
Fetch detail-view data generated from the model module.
Fetch edit-view data generated from the model module.
Create or update model data through the generated module API.
| method | Description | Example |
|---|---|---|
| [model]List[Suffix](...args, skip, limit, sort) | Loads a paginated list for a slice definition. | |
| [model]Insight[Suffix](...args) | Loads aggregation data for the same slice query. | |
| init[Model](query?, option?) | Initializes the default model list with list and insight data. | |
| init[Model][Suffix](...args) | Initializes a named slice list with args declared in signal.ts. | |
Loads a paginated list for a slice definition.
Loads aggregation data for the same slice query.
Initializes the default model list with list and insight data.
Initializes a named slice list with args declared in signal.ts.
Realtime room key for pubsub subscription channels.
Server-derived context such as Self, Req, Res, Ws, or custom internal args.
