Skip to content

Backport OverlappingFieldsCanMerge changes (v15) - #4899

Merged
yaacovCR merged 32 commits into
graphql:15.x.xfrom
yaacovCR:v15-overlap
Oct 21, 2026
Merged

yaacovCR merged 32 commits into
graphql:15.x.xfrom
yaacovCR:v15-overlap

Conversation

@yaacovCR

Copy link
Copy Markdown
Contributor

No description provided.

Motivation: Equivalent argument values must not conflict merely because their object fields appear in a different order.

Backport of 40c160e (graphql#3455), adapted to Flow and the v15 printer.
Motivation: Avoid repeatedly searching an argument list while checking overlapping fields.

Backport of 8f4c64e (graphql#3967), adapted directly from the v15 argument comparison.
Motivation: Keep field/fragment memoization separate so nested conflicts are not skipped while cycles still terminate.

Backport of 45e28a5 (graphql#4168).
Motivation: Keep import reordering separate from the collector changes.

Backports the rule-local import ordering from 47bd8c8 (graphql#3446).
Motivation: Describe cached collections and nullable parent types before changing their storage.

Backports the applicable annotations from 6b95561, adapted to Flow.
Motivation: Separate a cache hit from building a new collection.

Backports the collector control-flow change from 6b95561.
Motivation: Keep the algorithm description beside its entry point and correct duplicated words.

Backport of the rule algorithm comments in 8efb9fd (graphql#4741).
Motivation: Distinguish the validation context from the rule-local cache context.
Motivation: Keep comparison histories and collected-field caches together for one validation.

Backport of 87aaa4d (graphql#4855), without fragment-argument state.
Motivation: Document parent-conflict short circuits and reversed fragment traversal before changing comparison caches.

Backports the applicable cases from graphql#4843 and the current v17 nested-fragment test, retaining the release test harness.
Motivation: Name field records by the information they hold.

Backport of a1cc77b (graphql#4871).
Motivation: Name each response-name group before changing its representation.

Backport of 67c1ef7 (graphql#4872).
Motivation: Match the grouped-field terminology used by execution.

Backport of 4c6253e (graphql#4873).
Motivation: Use collectFields and CollectFieldsResult to match execution terminology; consider revisiting both collectors together in a follow-up.

Backport of 39d2c2d (graphql#4874).
Motivation: Give each field detail an explicit property name.

Backport of 22fad8e (graphql#4875).
Motivation: Name the grouped fields and referenced fragments in each collection result.

Backport of f36f3fe (graphql#4876).
Motivation: Make conflict reasons and locations explicit before bounding reporting.

Backport of 44ca750 (graphql#4877).
Motivation: Shared selection-set ASTs can have different field definitions under different parent types.

Backport of d5d4c96 (graphql#4879), without fragment-argument scope keys.
Motivation: Keep derived comparison data with the collection that owns it.

Backport of 3745f82 (graphql#4881), adapted without fragment arguments.
Store compared fragment names and their type-exclusivity flags on the collected field set. Keep the fragment-pair cache as a single class.

Motivation: Avoid an extra collection index when fragment arguments are absent.
Motivation: Avoid rebuilding object-entry arrays and skip empty field comparisons.

v15 retains object-based field collections, so cache their response names
instead of rebuilding arrays with Object.keys or objectEntries. v16 and
v17 iterate Maps directly and already skip empty collections using .size.
Motivation: Prepare argument lookups once per overlapping field record.

Backport of 5756cf3 (graphql#4883), adapted without fragment arguments.
Motivation: Compare argument values without formatting them for display.

Backport of 278eb44 (graphql#4886), adapted without fragment arguments.
Cache the field-name and argument conflict reason per field pair. Check return types and subfields separately.

Motivation: Without fragment arguments, a pair's name and argument comparison has one reusable result.

Backport of 3200265 (graphql#4889), adapted without fragment arguments.
Motivation: Prepare each argument value only once per validation.

Backport of b3a4488 (graphql#4890), adapted without fragment arguments.
Motivation: Reuse field-group matching when collected selection sets recur.

Backport of 0a81a6c (graphql#4893).
Motivation: Inline fragments are already collected at their enclosing response level; their nested fields remain independently visited.

Backport of 9fd9fe3 (graphql#4894).
Motivation: Keep nested diagnostic details bounded while retaining small messages.

Backport of 5680d04 (graphql#4895), omitting fragment-argument reporting.
Motivation: Retain representative conflict locations without repeatedly expanding their ancestry.

Backport of adaeb24 (graphql#4896).
Motivation: A lone fragment with no collected fields needs no comparison; its definition is validated separately.

Backport of ef9a666 (graphql#4898), adapted without fragment-argument preparation.
Stop validation after this rule has reported 100 conflicts, retaining the errors already reported.

Motivation: Match the reporting protection provided by the default error cap in v16 without changing the defaults for other v15 rules.
Spend a rule-local complexity budget on attempted comparisons and response-name matching. Abort validation when it is exhausted.

Motivation: Bound repeated validation work.

Backport of 19d0122 (graphql#4897), adapted without fragment scopes and preserving the v15 validation API.
@yaacovCR yaacovCR added the PR: bug fix 🐞 requires increase of "patch" version number label Oct 20, 2026
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@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
yaacovCR merged commit 5dac5e5 into graphql:15.x.x Oct 21, 2026
12 of 13 checks passed
@yaacovCR
yaacovCR deleted the v15-overlap branch October 21, 2026 13:58
yaacovCR added a commit that referenced this pull request Nov 4, 2026
## v15.11.0 (2026-11-04)

#### New Feature 🚀
* [#4985](#4985) Backport fixes to v15 ([@yaacovCR](https://github.com/yaacovCR))

#### Bug Fix 🐞
* [#4899](#4899) Backport OverlappingFieldsCanMerge changes (v15) ([@yaacovCR](https://github.com/yaacovCR))
* [#4910](#4910) Backport maxLexicalTokens, maxComments, maxSourceLength parser options (v15) ([@yaacovCR](https://github.com/yaacovCR))
* [#4918](#4918) fix: bound shared fragment traversal in introspection validation (v15) ([@yaacovCR](https://github.com/yaacovCR))

#### Committers: 1
* Yaacov Rydzinski ([@yaacovCR](https://github.com/yaacovCR))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: bug fix 🐞 requires increase of "patch" version number

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant