Attach DataLoader instances to the GraphQL context in the GraphQLModule.forRootAsync() context factory. The factory is called per request, so each request gets a fresh loader. Resolvers access the loader via the @Context() decorator instead of injecting the loader service directly into every resolver class.
Context factory is called per request — each request gets its own DataLoader instance automatically.
Avoids injecting the loader service into every resolver that needs it.
A single GqlContext interface documents all available loaders in one place.
Resolvers stay clean — access loaders via @Context() without constructor injection overhead.
Multiple loaders for different entities can all be attached to the same context object.