Skip to content

DataFetchingEnvironment getDataLoader doesn't match DataLoader signature #4179

Closed

Description

@ctbarbour

Describe the bug

DataFetchingEnvironment.getDataLoader<K, V>() has type parameters that are implicitly non-null due to @NullMarked but DataLoader<K, V extends @Nullable Object> explicitly allows nullable V. This creates a type mismatch when calling from Kotlin. As of Kotlin 2.1.0, Kotlin compiler treats JSpecify types as null-safe types.

To Reproduce

From Kotlin, attempt to get a DataLoader with a nullable value type:

// Kotlin sees getDataLoader as requiring V : Any
val loader: DataLoader<String, Player?>? = env.getDataLoader("PlayerLoader")
// Error: Type argument is not within its bounds: must be subtype of 'Any'

Activity

  1. github-actions commented on Jan 25, 2026

    @github-actions
    Contributor

    Hello, this issue has been inactive for 60 days, so we're marking it as stale. If you would like to continue this discussion, please comment within the next 30 days or we'll close the issue.

  2. github-actions commented on Feb 24, 2026

    @github-actions
    Contributor

    Hello, as this issue has been inactive for 90 days, we're closing the issue. If you would like to resume the discussion, please create a new issue.

  3. github-actions commented on Apr 26, 2026

    @github-actions
    Contributor

    Hello, this issue has been inactive for 60 days, so we're marking it as stale. If you would like to continue this discussion, please comment within the next 30 days or we'll close the issue.

  4. added
    keep-openTells Stale Bot to keep PRs and issues open
    and removed on Apr 27, 2026
  5. dondonz commented on Apr 27, 2026

    @dondonz
    Member

    Adding keep open - this should be fixed

  6. bbakerman commented on Jun 4, 2026

    @bbakerman
    Member

    I think this is fixed

    28e1e7a

    #4180

    I am going to close this

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