GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Getdataloader type bounds by ctbarbour · Pull Request #4180 · graphql-java/graphql-java

Conversation

@ctbarbour

@ctbarbour ctbarbour commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

The @NullMarked annotation on DataFetchingEnvironment makes type parameters implicitly non-null, but java-dataloader's DataLoader declares V extends @nullable Object to allow nullable values.

This mismatch prevents Kotlin consumers from expressing nullable value types without unsafe casts when returning CompletableFuture from data fetchers.

Add explicit V extends @nullable Object bound to match DataLoader's type signature, enabling proper nullability propagation to Kotlin.

#4179

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ctbarbour added 2 commits November 25, 2025 21:43
@ctbarbour
Fix getDataLoader type bounds for nullable values
28e1e7a
The @NullMarked annotation on DataFetchingEnvironment makes type
parameters implicitly non-null, but java-dataloader's DataLoader
declares V extends @nullable Object to allow nullable values.

This mismatch prevents Kotlin consumers from expressing nullable
value types without unsafe casts when returning CompletableFuture
from data fetchers.

Add explicit V extends @nullable Object bound to match DataLoader's
type signature, enabling proper nullability propagation to Kotlin.
@ctbarbour
remove comment
0d784ac
bbakerman
bbakerman approved these changes Nov 25, 2025
View reviewed changes

@bbakerman bbakerman left a comment

Copy link
Copy Markdown
Member

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.

Thanks for this.

Moving to JSpecify is an interesting exercise because while it "allows for more precise nullability specifications" its only the Kotlin compiler that truly enforces it.

So this mismatch for example survives a Java compile but not a Kotlin one.

I wonder if we are missing some Java setting that would catch this earlier

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dondonz dondonz modified the milestones: 26.x, 26.x breaking changes, 25.1 bugfix & non-breaking changes Dec 4, 2025
@dondonz
dondonz merged commit 021fe1b into graphql-java:master Dec 7, 2025
4 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mrmegapolys mrmegapolys mentioned this pull request Apr 2, 2026
DataFetcherResult.newResult<T>() type parameter missing @Nullable bound for Kotlin JSpecify interop #4364
Closed
@samuelAndalon samuelAndalon mentioned this pull request May 2, 2026
DataFetchingEnvironment#getDataLoader does not allow nullable DataLoader values in Kotlin #4374
Closed
@bbakerman bbakerman mentioned this pull request Jun 4, 2026
DataFetchingEnvironment getDataLoader doesn't match DataLoader signature #4179
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bbakerman bbakerman bbakerman approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

25.1 bugfix & non-breaking changes

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ctbarbour @bbakerman @dondonz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.