Confect functions are defined as a spec and impl pair. The spec declares each function’s name, arguments, and return type. The impl provides the handler logic.Documentation Index
Fetch the complete documentation index at: https://confect.dev/llms.txt
Use this file to discover all available pages before exploring further.
Function types
| Constructor | Description |
|---|---|
FunctionSpec.publicQuery | Public query function |
FunctionSpec.publicMutation | Public mutation function |
FunctionSpec.publicAction | Public action function |
FunctionSpec.internalQuery | Internal query function |
FunctionSpec.internalMutation | Internal mutation function |
FunctionSpec.internalAction | Internal action function |
Defining a spec
Each function spec defines the function’s name, arguments schema, and returns schema. Function specs are grouped into group specs, which are combined into your API’s top-level spec. See The Spec/Impl Model for a full walkthrough.confect/notes.spec.ts
confect/spec.ts
Implementing functions
Each function impl contains a handler that implements the function’s logic. Function impls are composed into group impls using Effect layers. The handler receives the decoded arguments as its first parameter and returns anEffect. Use the generated services (like DatabaseReader, DatabaseWriter, Auth, etc.) inside your handler to interact with Convex.
confect/notes.impl.ts
impl.ts file in your confect/ directory, and must be finalized with Impl.finalize.
confect/impl.ts