Auto-configure DataLoaderRegistrar components

This commit configures all `DataLoaderRegistrar` application components
with the `GraphQlService`. This allows applications to contribute
`DataLoader` instances without using the annotated-controller
programming model.

Closes gh-189
This commit is contained in:
Brian Clozel
2021-11-24 16:18:40 +01:00
parent d0adceee4b
commit 36a84f58bd
6 changed files with 49 additions and 7 deletions

View File

@@ -258,6 +258,10 @@ public class BookController {
}
----
`BatchLoaderRegistry` is itself a `DataLoaderRegistrar`, as it will register `DataLoader` instances for each request.
Applications can also contribute other `DataLoaderRegistrar` instances as components - they will be configured with
the `ExecutionGraphQlService` automatically.
@@ -451,6 +455,7 @@ By default, `@GraphQlTest` limits scanning to the following beans:
- `@Controller`
- `RuntimeWiringConfigurer`
- `DataLoaderRegistrar`
- `JsonComponent`
- `Converter`
- `GenericConverter`