Skip to content

PerLevelDataLoaderDispatchStrategy no longer hooks into DataLoaderRegistry.dispatchAll() #4134

Closed

Description

@jjacobs44

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.

Activity

  1. andimarek commented on Oct 10, 2025

    @andimarek
    Member

    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.

  2. jjacobs44 commented on Oct 10, 2025

    @jjacobs44
    Author

    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.

  3. andimarek commented on Oct 11, 2025

    @andimarek
    Member

    Thanks for explaining more. This is probably an unwanted change we have to look into more.

    Cc @bbakerman

  4. added
    keep-openTells Stale Bot to keep PRs and issues open
    on Oct 15, 2025
  5. andimarek commented on Nov 10, 2025

    @andimarek
    Member

    thanks for reporting @jjacobs44 ... that is now fixed with and #4164 and will is released as 25.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    keep-openTells Stale Bot to keep PRs and issues open

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions