Skip to content

Fix duplicate typename__ when type implements multiple interfaces - #1

Draft
magicmark wants to merge 1 commit into
fix/duplicate-typename-fieldsfrom
fix/duplicate-typename-dedup
Draft

Fix duplicate typename__ when type implements multiple interfaces#1
magicmark wants to merge 1 commit into
fix/duplicate-typename-fieldsfrom
fix/duplicate-typename-dedup

Conversation

@magicmark

Copy link
Copy Markdown
Owner

Fixes the bug from the xfail test — _resolve_selection_set merges fields from all matching inline fragments, so when a type implements interfaces Bar and Baz and both spreads select __typename, you get it twice.

The fix deduplicates fields by name at the end of _resolve_selection_set, keeping the first occurrence. All 924 existing tests pass unchanged.

When multiple inline fragments (targeting different interfaces a type
implements) each select the same field, only keep the first occurrence.

Co-Authored-By: Claude <noreply@anthropic.com>
@magicmark
magicmark force-pushed the fix/duplicate-typename-fields branch from 8c93608 to 22e36c5 Compare July 7, 2026 21:46
@magicmark
magicmark force-pushed the fix/duplicate-typename-dedup branch from bbefd8b to 3f3b17f Compare July 7, 2026 21:46
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.

1 participant