-
Notifications
You must be signed in to change notification settings - Fork 50
Add documentation for Chained DataLoaders #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments
documentation/batching.md
Outdated
``` | ||
|
||
### How do I enable Chained DataLoaders? | ||
As this changes execution order, you must opt-in to Chained DataLoaders by setting key-value pairs in `GraphQLContext`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we actually recommend people to use the UnusualConfiguration option and not directly put stuff into the GraphQLContext. See https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/GraphQLUnusualConfiguration.java
I think we need todo a follow up PR to add this config there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok will change this
A note for another PR - other documentation pages will need an update to use the central Configuration class
documentation/batching.md
Outdated
2. Provide a `ScheduledExecutorService` to GraphQL Java, with key `DataLoaderDispatchingContextKeys.DELAYED_DATA_LOADER_DISPATCHING_EXECUTOR_FACTORY` and value implementing `DelayedDataLoaderDispatcherExecutorFactory` | ||
|
||
### What changed in GraphQL Java 25.0? | ||
The DataFetcher in the example above, before version 25.0 would have caused execution to hang, because the first DataLoader ("name") was never dispatched. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the first would dispatch, but not the second ("email")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad - will update
This is a new feature coming in v25.0, and is available via the preview version v25.0.beta-2
This is written taking into account feedback regarding the confusion of the batch window configuration