You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PerLevelDataLoaderDispatchStrategy no longer hooks into DataLoaderRegistry.dispatchAll() #4134
Describe the bug
As of v25 there is no longer a hook into dataLoaderRegistry.dispatchAll() (prev code) within PerLevelDataLoaderDispatchStrategy. This previously allowed us to take advantage of the ScheduledDataLoaderRegistry feature within the java-dataloader library for specifying DispatchPredicate's per dataloader. It's not clear to me if I'm missing some new mechanism that replaces this, or if this is just a regression/bug.
To Reproduce
Not a very minimal set up at all (sorry), but you can see how the difference in behavior affects us by comparing this branch to master and using the messageLoaderWithScheduledDispatch test.
That's a different dispatchAll than the one I'm referring to. That implementation just directly calls dispatch() on each of the dataloaders as opposed to dataLoaderRegistry.dispatchAll() which is overriden here.
The previous graphql-java implementation called this here in v24.
FWIW I'm a DGS maintainer so this is a change in behavior for us that we're actively trying to work out to make DGS compatible with graphql-java 25, spring-graphql 2, and boot 4.
Activity
andimarek commentedon Oct 10, 2025
Hi,
dispatchAll is still called (unless you set the new https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/execution/instrumentation/dataloader/DataLoaderDispatchingContextKeys.java#L25C32-L25C59).
You can see the code here: https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/execution/instrumentation/dataloader/PerLevelDataLoaderDispatchStrategy.java#L467
But we worked a lot on the dispatching strategy in 25, so there might be another change that affect you.
You also linked to the DGS framework: I would recommend also to open issue their to ask for help.
jjacobs44 commentedon Oct 10, 2025
Hello! Thanks for such a quick reply.
That's a different dispatchAll than the one I'm referring to. That implementation just directly calls dispatch() on each of the dataloaders as opposed to
dataLoaderRegistry.dispatchAll()which is overriden here.The previous graphql-java implementation called this here in v24.
FWIW I'm a DGS maintainer so this is a change in behavior for us that we're actively trying to work out to make DGS compatible with graphql-java 25, spring-graphql 2, and boot 4.
andimarek commentedon Oct 11, 2025
Thanks for explaining more. This is probably an unwanted change we have to look into more.
Cc @bbakerman
andimarek commentedon Nov 10, 2025
thanks for reporting @jjacobs44 ... that is now fixed with and #4164 and will is released as 25.0