Multiple WiringFactory registrations

CombinedWiringFactory makes use of multiple WiringFactory instances
possible, but RuntimeWiring.Builder does not use it by default.

This change enables use of multiple WiringFactory instances through
an extra callback on RuntimeWiringConfigurer that allows multiple
parties to add their own WiringFactory.

See gh-244
This commit is contained in:
rstoyanchev
2022-01-14 18:44:54 +00:00
parent be74ba2b59
commit 2ecac0bd35
4 changed files with 183 additions and 8 deletions

View File

@@ -213,6 +213,11 @@ You can use `RuntimeWiringConfigurer` to register:
`AnnotatedControllerConfigurer`, which detects annotated, `DataFetcher` handler methods.
The Spring Boot starter adds the `AnnotatedControllerConfigurer` by default.
If you need to add a `WiringFactory`, e.g. to make registrations that take into account
schema definitions, implement the alternative `configure` method that accepts both the
`RuntimeWiring.Builder` and an output `List<WiringFactory>`. This allows you to add any
number of factories that are then invoked in sequence.
The Spring for GraphQL Boot starter detects beans of type `RuntimeWiringConfigurer`.