Repository navigation
Decode every root field of a GraphQL operation - #3526
Merged
Merged
Conversation
Signed-off-by: Marvin Froeder <velo.br@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #3525
GraphqlDecoderunwrappeddataand decoded only the first root field, so an operation selecting two root fields — legal GraphQL, one round trip — silently dropped everything after the first.Decoder
When
datacarries more than one key, the wholedatamap is converted into the return type, so each root field binds to its matching component/property. A single root field keeps unwrapping exactly as before (including array-to-single unwrapping andOptional), so existing clients are unaffected.Code generation
feign-graphql-aptgenerated the return record from the first root field's type. It now mirrors the operation's own selection set when several root fields are selected — one component per root field, each with its own inner record:Single-root-field queries still generate the record for that field's type.
Tests
GraphqlDecoderTest: multiple root fields into a record, mixed shapes (object + list), null root field,Optionalreturn, errors with multiple root fieldsGraphqlClientTest: end-to-end multi-root query overMockWebServerGraphqlSchemaProcessorTest: multi-root generation, list/scalar shapes, single-root regressionmvn test -pl graphql,graphql-apt -amis green. READMEs for both modules document the behaviour.🤖 Generated with Claude Code