Skip to content

Native Image: Relay Window edges return null nodes due to missing runtime hints for graphql-java relay types #1479

Description

@JBodkin-Amphora

When using Spring GraphQL with a relay connection backed by Spring Data's Window type (I'm returning Window from a controller and not using the full Spring Data integration), the generated GraphQL response contains edges whose node field is null when running as a GraalVM native image. The same query works correctly on the JVM. After investigation, it appears that graphql-java resolves relay edge properties via reflection in PropertyFetchingImpl.

The relay implementation classes involved are:

  • graphql.relay.DefaultConnection
  • graphql.relay.DefaultConnectionCursor
  • graphql.relay.DefaultEdge
  • graphql.relay.DefaultPageInfo

Adding runtime hints for these types resolves the issue in my application.

The graphql-java Relay types appear in the GraalVM reachability metadata for graphql-java 19.2 however, they do not appear in the metadata for graphql-java 19.7:. I'm not sure whether the existing metadata conditions are expected to apply in this scenario, particularly when the controller return type is Window.

Since Spring GraphQL creates and exposes these relay types when adapting a Window to a relay connection, should Spring GraphQL register runtime hints for these graphql-java relay implementation classes?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions