Auto-generated controllers
The simplest setup is theendpoints option of NestjsQueryRestModule. Each entry creates a Nest controller backed by an entity, assembler, or custom QueryService.
todo-item.module.ts
AssemblerClass instead of EntityClass when an assembler maps the entity and DTO, and register the assembler in the module’s assemblers array. Use ServiceClass when the endpoint is backed directly by a custom QueryService, and register that provider in services.
Custom controllers
ExtendCRUDController to override an endpoint or add ordinary Nest routes. Register the controller and DTO with NestjsQueryRestModule so authorizers and hooks are provided.
todo-item.controller.ts
CreateController, ReadController, UpdateController, DeleteController, or ExportController instead.
Options
Top-levelCRUDController and endpoint options include:
CreateDTOClassandUpdateDTOClassselect mutation body DTOs.basePathoverrides the generated controller path.dtoNamechanges the name used to derive operation IDs and the default path.pagingStrategy,defaultResultSize,maxResultsSize,defaultSort,defaultFilter,disableFilter,enableSearch, andenableTotalCountconfigure collection queries.guards,interceptors,pipes,filters,decorators, andtagsapply Nest or OpenAPI behavior to all generated methods.create,read,update,delete, andexportconfigure one controller group independently.
disabled. The one and many nested options support a custom path, description, operationOptions, and method-level guards, interceptors, pipes, filters, decorators, and tags.
Static paths can conflict with the default
:id route. The generated export route is registered as /export; avoid using
export as a record identifier, and use explicit custom paths when necessary.