feat: adopt Sangria's overlapping fields algorithm#4840
Open
yaacovCR wants to merge 3 commits into
Open
Conversation
|
@yaacovCR is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel. A member of the Team first needs to authorize it. |
yaacovCR
force-pushed
the
sangria
branch
2 times, most recently
from
July 21, 2026 19:43
873981c to
eb4ee4d
Compare
Adopt Sangria's grouped, cached field-set algorithm while preserving GraphQL.js error paths, wording, and source nodes as closely as possible. Keep the established validator for documents using the experimental fragment-arguments syntax so the core algorithm can be reviewed independently of invocation-specific variable binding. Bound all work performed by this rule with an internal 100,000-unit budget. Charge field collection and comparison, merged field-set construction, fragment expansion, grouping, and proof work where each operation occurs. This follows the original GraphQL.js performance issue, Sangria's grouped-algorithm pull request, and Sangria's validation performance issue.
Bind fragment variables as compact scopes on the same selection-set graph, reject incompatible spread arguments before fieldless-root canonicalization, and share alpha-equivalent bound proofs. Apply the same 100,000-unit total-work budget to bound field-set expansion, argument canonicalization, grouping, comparisons, reporting, and proof caching. Replacing the fallback pairwise fragment comparisons with grouped bound proofs lets repeated fragment bindings consume fewer units without changing the limit. This builds on the fragment arguments proposal and its GraphQL.js implementation.
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.
Replace the recursive pairwise validator with an indexed field-set graph algorithm adapted from Sangria. Preserve GraphQL.js error messages as closely as practical through representative conflict sampling, nested reasons, stable source ordering, and dedicated fragment-argument diagnostics.
Prior art/context: