- Query — read-only, can subscribe to changes
- Mutation — writes through the transactional path
- Action — arbitrary side effects (HTTP calls, emails, file ops)
Writing a function
Create a file infunctions/:
createMessage is callable at POST /api/fn/createMessage.
Context object
ctx gives you:
Validators
v.* describes expected argument shapes:
Queries
Actions
Use for side effects outside the database:Calling functions from the client
Errors
Throw typed errors that propagate to the client with structured codes:{ code, message } and can render different UI per code. See Error codes for the canonical list.
Next
Live queries
How query subscriptions stay in sync.
Validators
All argument shapes
v.* supports.