Skip to content

fix: Duplicate deferred fragment identifiers #700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

calvincestari
Copy link
Member

Fixes apollographql/apollo-ios#3565.

The deferred fragment identifier was being generated using all elements in the deferred fragments path type info array. While the contents of that array are correct because of the unique selection sets, the identifier is able to be shared amongst elements with the same path and defer condition. Taking this into account the identifiers are now generated without duplicates.

Copy link

netlify bot commented Jul 3, 2025

Deploy Preview for apollo-ios-docc canceled.

Name Link
🔨 Latest commit 09fa71b
🔍 Latest deploy log https://app.netlify.com/projects/apollo-ios-docc/deploys/686713156199310008a3c3d4

@apollo-librarian
Copy link

apollo-librarian bot commented Jul 3, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 04f9eb3a3d720a23f3df0d32

@calvincestari calvincestari requested a review from AnthonyMDev July 3, 2025 23:33
/// fragment identifier which is shared amongst all child selection set types within a deferred fragment.
///
/// - Returns: Hash value of `path` and `deferCondition`.
var pathDeferConditionHash: Int {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative to this and the unique(by:) extension on Sequence was to make DeferredPathTypeInfo conform to Hashable but manipulate the hashing and equality functions to exclude typeName. That felt like a step too far removed from what I was trying to do, so I settled on this specific implementation instead.

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.

Duplicate DeferredFragmentIdentifiers generated
1 participant