⚡ Sangsakala Proxy 🏠 Home
Skip to content

Breaking change for v27: default to exhausted DataLoader dispatching - #4534

Open
andimarek wants to merge 1 commit into
masterfrom
codex/exhausted-dispatch-default-v27
Open

andimarek wants to merge 1 commit into
masterfrom
codex/exhausted-dispatch-default-v27

Conversation

@andimarek

Copy link
Copy Markdown
Member

Breaking change — targeted for GraphQL Java 27. Do not backport to 26.x or earlier.

Use ExhaustedDataLoaderDispatchStrategy instead of PerLevelDataLoaderDispatchStrategy when automatic dispatching is enabled and no strategy is configured. Exhausted dispatching runs queued loads when the tracked fetching/completion work and batch loading are exhausted, and supports chained loads without an opt-in.

Compatibility and migration

  • Dispatch timing and batch composition can change: batches are no longer tied to query levels.

  • Obtain loaders through DataFetchingEnvironment.getDataLoader(...). The default now returns the tracking wrapper; loading directly through the registry or a separately held loader bypasses tracking and can leave requests waiting indefinitely.

  • To retain per-level dispatching for a request:

    GraphQL.unusualConfiguration(executionInput)
            .dataloaderConfig()
            .enableDataLoaderExhaustedDispatching(false);
  • Existing enableDataLoaderChaining(true) continues to select per-level chained dispatching when exhausted dispatching is unset. Explicitly enabling both strategies still fails. Disabling automatic dispatch and requests without a supplied registry still use the no-op strategy.

Implementation and tests

Update strategy selection, loader wrapping, the configuration getter, and Javadoc together. Add selection coverage for queries, mutations, and subscriptions; verify the effective configuration on context builders and contexts, default chained loading, loader wrapping, and the explicit per-level migration path. Migrate the hanging-test fixture to tracked loader access and test it with both strategies. Update the deferred batching assertion to account for the new default's timing.

Validation: ./gradlew --no-daemon test testng jacocoTestReport javadoc passed on Java 25. No per-class coverage regressions against test-baseline.json using the CI comparison rules.

@andimarek andimarek added the breaking change requires a new major version to be relased label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 17 6225 (+47 🟢) 6169 (+47 🟢) 0 (±0) 0 (±0) 56 (±0)
Java 21 6225 (+47 🟢) 6169 (+47 🟢) 0 (±0) 0 (±0) 56 (±0)
Java 25 6225 (+47 🟢) 6169 (+47 🟢) 0 (±0) 0 (±0) 56 (±0)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 18707 (+141 🟢) 18539 (+141 🟢) 0 (±0) 0 (±0) 168 (±0)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 30327 3078 90.8% ±0.0%
Branches 8962 1504 85.6% ±0.0%
Methods 8096 1186 87.2% ±0.0%

Changed Class Coverage (3 classes)

Class Line Branch Method
g.e.Execution +0.1% 🟢 +4.2% 🟢 ±0.0%
g.GraphQLUnusualConfiguration
$DataloaderConfig
+37.5% 🟢 +100.0% 🟢 +40.0% 🟢
g.s.DataFetchingEnvironmentImpl +1.3% 🟢 +8.3% 🟢 ±0.0%

Full HTML report: build artifact jacoco-html-report

Updated: 2026-11-03 22:04:41 UTC

This branch has not been deployed

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

Labels

breaking change requires a new major version to be relased

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants