[pull] master from dotansimha:master - #238
Merged
Merged
Conversation
…s as written to stop OOM with nested fragments (#10940) (#10982) * test: reproduce #10940 — type cache keys grow exponentially with nested fragment reuse Synthetic repro: fragments F0..F7 where each spreads the previous one under three fields. With `inlineFragmentTypes: 'combine'` the generated output is ~2.3 KB, but the `typeCache` keys built from the fragment-expanded field paths (`getFieldNames`) reach 180 KB for a single key and 483 KB in total, growing ~3.3x per extra nesting level. On large projects this runs out of memory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013DCrEAx4J6ze2GV4FinZs5 eddeee888:oss:issue-verify * test: reduce #10940 repro to the minimal config Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013DCrEAx4J6ze2GV4FinZs5 * fix: build type cache keys from selection sets as written, not fragment-expanded paths (#10940) The per-selection-set type cache was keyed by every fragment-expanded field path (`getFieldNames`), so keys grew exponentially with nested fragment reuse and exhausted memory on large projects. Keys now describe the selection set as written (fragment spreads by name, plus directives and inline fragments), built by `getSelectionSetCacheKey` and memoized per node in `selectionSetCacheKeys` (both @internal). `getFieldNames` is removed. The repro test now spies on `selectionSetCacheKeys` instead of `Map.prototype.set`. Co-authored-by: Eddy Nguyen <ch@eddeee888.me> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013DCrEAx4J6ze2GV4FinZs5 eddeee888:oss:issue-fix --------- Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )