Skip to content

Deduplicate external fragments in near-operation-file preset#1454

Open
Nurou wants to merge 1 commit intodotansimha:mainfrom
Nurou:nurou/dedupe-near-op-external-fragments
Open

Deduplicate external fragments in near-operation-file preset#1454
Nurou wants to merge 1 commit intodotansimha:mainfrom
Nurou:nurou/dedupe-near-op-external-fragments

Conversation

@Nurou
Copy link
Copy Markdown

@Nurou Nurou commented Apr 28, 2026

This deduplicates externalFragments by name in near-operation-file when multiple source documents are merged into the same generated output.

Why:

  • multiple documents can resolve to the same generated file and each contribute the same external fragment
  • downstream plugins then receive repeated externalFragments, which can cause severe perf blow-ups

This is related to #752 and supersedes the narrower consumer-side fix I initially opened in dotansimha/graphql-code-generator#10728.

Validation:

  • added a regression test that merges two documents into the same generated output and asserts externalFragments are deduped

Downstream benchmark from the original report:

  • before: ~248s
  • after dedupe: ~2s

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 28, 2026

⚠️ No Changeset found

Latest commit: 755dce7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants