nest-zero-synced-queries package
Home > @cbnsndwch/nest-zero-synced-queries
nest-zero-synced-queries package
Classes
Class
Description
Dynamic module for Zero Synced Queries infrastructure.
This module provides all the plumbing needed for Zero synced queries: - Automatic discovery of @SyncedQuery methods in controllers and providers - HTTP endpoint for query transformation requests from Zero cache - Query execution and AST conversion service - Error handling per Zero protocol
## Usage
Import this module in your app module using forRoot() to configure:
Service for discovering and managing synced query handlers.
This service implements the discovery pattern similar to NestJS microservices, scanning for decorated methods and building a registry of query handlers.
Service for transforming Zero query requests into AST responses.
This service coordinates: 1. Looking up query handlers in the registry 2. Executing handlers with user context and arguments 3. Converting query builders to AST format 4. Handling errors per Zero protocol
Enumerations
Enumeration
Description
Parameter types that can be injected into query handlers.
Functions
Function
Description
getParameterMetadata(target, propertyKey)
Get parameter metadata for a method.
Parameter decorator to inject a query argument by index.
Use this decorator to explicitly map query arguments to method parameters.
SyncedQuery(queryName, inputSchema)
Decorator for Zero synced query handlers.
Use this decorator to mark a method as a synced query handler. Works on both controllers and providers.
Interfaces
Interface
Description
Registered query handler with metadata and execution context.
Configuration options for the SyncedQueriesModule.
Configuration for a synced query handler.
Metadata for a parameter decorator.
Error response for failed query transformation.
Successful query transformation response.
Request item structure from Zero cache server.
Variables
Variable
Description
Metadata key for synced query handlers.
Used by decorator to mark methods as query handlers and store their configuration.
Metadata key for storing parameter decorator information.
Type Aliases
Type Alias
Description
Type definition for a query handler function.
Union type for query transformation results.
Request body type from Zero cache (array of query requests).
How was this page?