Repository navigation
Conversation
Port the focused cleanup from the 26.x backport in #4450 to master.
Contributor
Test ReportTest Results
Code Coverage (Java 25)
Changed Class Coverage (12 classes)
|
Keep the higher-level SDL and argument-default regression tests on master.
This branch has not been deployed
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.
Programmatic argument defaults can reach circular input-field defaults before schema traversal visits the input type. For example, an argument of type
Wrapper { child: Recursive }with default{child: {}}expandsRecursive { next: Recursive = {} }until aStackOverflowErroroccurs.This PR validates default containers and cycles before running validators that coerce values. Invalid defaults now produce schema validation errors instead of consuming iterators/streams or overflowing the stack.
IteratorandBaseStreamdefaults during schema validation, including values nested in maps, iterables, or arrays. This covers argument, input-field, and directive-argument defaults, including deprecated internal defaults. The setters only store values; they do not traverse or validate them.InvalidSchemaExceptionwithInvalidDefaultValueerrors. An uncheckedFastBuilderdefers rejection until explicit validation.Iterableand Java arrays.General runtime iterator/stream coercion remains unchanged. Iterable and array defaults remain supported. Container errors are returned before cycle checking; cycle errors are returned before the remaining validators. Consequently, unrelated errors from later stages are omitted when an earlier stage fails. All discovered errors within the failing stage are collected.
The existing SDL integration tests are retained. Added coverage includes nested argument defaults, list/array wrappers, directive-only input types, multiple independent cycles, repeated validation, and both schema builders with validation enabled. Mocked scalar coercion verifies that default cycles are rejected before coercion. Container tests verify that setters do not traverse values, unsupported sources are not consumed, mutations after setting a default are caught, and valid container defaults work across repeated queries.
Based on the circular-default cleanup in #4450 and merged with master (
96443c271).Validation on Java 25:
./gradlew test testng check javadoc jacocoTestReportpassed: 6,321 Spock cases and 141 TestNG cases passed (7 and 49 skipped, respectively).