@nestjs-yalc/data-loader
v1.3.3
Published
NestJS DataLoader helpers for batching entity lookups and exposing injectable loader providers.
Downloads
259
Readme
@nestjs-yalc/data-loader
NestJS DataLoader helpers for batching entity lookups and exposing injectable loader providers.
Use this package directly when you need the YALC dataloader primitive without the higher-level CrudGen resource factory.
Installation
npm install @nestjs-yalc/data-loaderMain Exports
GQLDataLoaderfor request-scoped entity batching.DataLoaderFactoryfor creating Nest providers around a repository-backed loader.getDataloaderTokenfor deriving the provider token used by generated modules.SearchKeyTypeand helper functions for selecting lookup keys.
Example
import { DataLoaderFactory } from '@nestjs-yalc/data-loader';
export const userDataloaderProvider = DataLoaderFactory('id', UserEntity);Documentation
CrudGen uses this package internally for generated GraphQL dataloaders: https://github.com/NestDevLab/nestjs-yalc/blob/dev/docs/crud-gen-factory.md
