QuerydslDataFetcher does not preserve path prefix when flattening nested parameters #1215
Labels
in: data
Issues related to working with data
status: waiting-for-triage
An issue we've not yet triaged
Describe the Bug
In
org.springframework.graphql.data.query.QuerydslDataFetcher
, the private methodaddParameters(...)
fails to preserve the parent path prefix when recursively processing nested input arguments. This leads to incorrect flattening of nested object fields into parameter names.Expected Behavior
Given a GraphQL query with nested object fields, such as:
The expected parameter map should include keys like:
But currently it produces:
The
profile.
prefix is missing.Actual Behavior
The path prefix is dropped during recursion because the method call:
does not incorporate the existing
prefix
. As a result, only the current key is passed as the new prefix, and the hierarchical path is not preserved.Affected Code
Suggested Fix
Update the recursive call to include the full path:
This ensures nested paths are flattened correctly into fully qualified keys.
Version
spring-graphql
: 1.3.4 (or whichever version you're using)QuerydslDataFetcher
was introducedImpact
This issue causes incorrect behavior when using nested input types (e.g., object fields like
profile.name
) in queries. It breaks parameter-based filtering when relying onQuerydslBindings
.The text was updated successfully, but these errors were encountered: