You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
count good faith introspection fields on repeated fragment spreads - #4515
a named fragment that is spread more than once gets around the good faith cap on __Type.fields / inputFields / interfaces / possibleTypes:
query {
__schema { a1: types { ...T } a2: types { ...T } ... a120: types { ...T } }
}
fragment T on __Type { fields { type { name } } }
# schema with 300 types x 20 fields
inline, 2 selections: BadFaithIntrospectionError: __Type.fields is present too often!
fragment, 120 spreads (2.5 KB query): no error, 14.6 MB response, 5.8 s
fragment, 120 spreads, patched: BadFaithIntrospectionError: __Type.fields is present too often!
OperationValidator.checkFragmentSpread only traverses a fragment on its first spread in an operation. later spreads add the cached FragmentComplexityInfo field count and depth, so the 500 field / 20 depth limits still hold (120 spreads x 4 fields stays under 500), but checkGoodFaithIntrospection never sees the fields inside them, and every re-spread repeats the full types x fields walk without being counted.
FragmentComplexityInfo now also keeps the good faith keys counted during the fragment's first traversal (nested fragments included), and a later spread counts them again, so it behaves the same as writing the selection inline. fragments without cycle forming fields, like TypeRef and InputValue in the standard introspection query, record nothing and are unaffected. this is the cached path that #4490 did not cover; that change handled __schema reached through a fragment's first traversal.
Full HTML report: build artifact jacoco-html-report
Updated: 2026-10-27 16:11:51 UTC
This branch has not been deployed
No deployments
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
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.
a named fragment that is spread more than once gets around the good faith cap on
__Type.fields/inputFields/interfaces/possibleTypes:OperationValidator.checkFragmentSpreadonly traverses a fragment on its first spread in an operation. later spreads add the cachedFragmentComplexityInfofield count and depth, so the 500 field / 20 depth limits still hold (120 spreads x 4 fields stays under 500), butcheckGoodFaithIntrospectionnever sees the fields inside them, and every re-spread repeats the full types x fields walk without being counted.FragmentComplexityInfonow also keeps the good faith keys counted during the fragment's first traversal (nested fragments included), and a later spread counts them again, so it behaves the same as writing the selection inline. fragments without cycle forming fields, likeTypeRefandInputValuein the standard introspection query, record nothing and are unaffected. this is the cached path that #4490 did not cover; that change handled__schemareached through a fragment's first traversal.