Repository navigation
Conversation
Contributor
Test ReportTest Results
Code Coverage (Java 25)
Changed Class Coverage (2 classes)
|
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.
Spock, MaxQueryDepthInstrumentation(6) on
{f1: foo {...F} f2: foo {foo {foo {foo {...F}}}} } fragment F on Foo {foo {foo {scalar}}}, before the change:the query is 7 deep. written inline it is rejected with
maximum query depth exceeded 7 > 6.QueryTraverserfollows a spread by handing the sharedFragmentDefinitionnode tographql.util.Traverser, which enters a node only once and treats later encounters as back references. every spread of a fragment after the first is skipped together with the fields under it, even when it sits under a different parent field (#1695).MaxQueryComplexityInstrumentation,MaxQueryDepthInstrumentationandFieldValidationInstrumentationall run onQueryTraverser, so a client can put the expensive part of a query behind a fragment it spreads more than once and have it neither counted nor validated. with the default1 + childComplexitycalculator:NodeVisitorWithTypeTracking.visitFragmentDefinitionnow removes the fragment's nodes from the traverser's visited set when the definition is left, so the next spread is followed again. a spread of a fragment inside its own body still finds it visited while it is being traversed, so fragment cycles still terminate (covered by a test). this is what theQueryTraverserjavadoc already describes (no field merging), and it is the same per spread countingOperationValidatoruses for its field count limit, which also bounds how far repeated spreads can expand.one behaviour change to be aware of: scores go up for queries that reuse fragments. the standard introspection query goes from 64 to 191 with the default calculator (depth stays at 13), so a
MaxQueryComplexityInstrumentationlimit set between those two values will start rejecting it.the new tests in
QueryTraverserTest,MaxQueryDepthInstrumentationTestandMaxQueryComplexityInstrumentationTestfail before the change. the fulltestandtestngsuites pass on Java 25, and the analysis tests pass on 17 and 21.