Skip to content

Conversation

calvincestari
Copy link
Member

This is related to apollographql/apollo-ios#3579 but targets a fix in the 1.0 branch.

An Optional type wrapped by AnyHashable exhibits weird behaviour when checking equality of a non-optional type, eg: Swift == Swift?. The fix in 1.x is to recover the type data lost through using AnyHashable in DataDict and then cast the field data as the field's concrete type for equality checks.

Copy link

netlify bot commented Sep 24, 2025

Deploy Preview for apollo-ios-docc canceled.

Name Link
🔨 Latest commit c3d36ac
🔍 Latest deploy log https://app.netlify.com/projects/apollo-ios-docc/deploys/68dd76ccaf4e40000885d32f

@apollo-librarian
Copy link

apollo-librarian bot commented Sep 24, 2025

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 3 changed, 0 removed
* (developer-tools)/ios/v1/client-directives.mdx
* (developer-tools)/ios/v1/caching/cache-key-resolution.mdx
* (developer-tools)/ios/v1/caching/programmatic-cache-keys.mdx

Build ID: e22582b15ab6a851b4ea02c4
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/e22582b15ab6a851b4ea02c4

@calvincestari calvincestari marked this pull request as draft September 25, 2025 20:04
@calvincestari calvincestari marked this pull request as ready for review September 29, 2025 21:44
__data[key]
}

public static func == (lhs: MockSelectionSet, rhs: MockSelectionSet) -> Bool {
Copy link
Member Author

Choose a reason for hiding this comment

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

SelectionSet now has it's own equality implementation.

@calvincestari calvincestari changed the base branch from main to v1 October 1, 2025 19:41
@calvincestari calvincestari force-pushed the fix/v1-equality-check branch from 52a7915 to 893a4f5 Compare October 1, 2025 22:10
@calvincestari calvincestari force-pushed the fix/v1-equality-check branch from 87a2466 to ab8f785 Compare October 7, 2025 19:19
Copy link
Contributor

@AnthonyMDev AnthonyMDev left a comment

Choose a reason for hiding this comment

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

Minor unit test suggestion

@calvincestari calvincestari merged commit 5f317ce into v1 Oct 8, 2025
27 checks passed
@calvincestari calvincestari deleted the fix/v1-equality-check branch October 8, 2025 22:39
calvincestari added a commit that referenced this pull request Oct 10, 2025
6f790b999 Release 1.25.0 (#797)
97e8b7477 fix: `SelectionSet` equality (#771)

git-subtree-dir: apollo-ios
git-subtree-split: 6f790b99991dca454a6aaf955ee9f816432d5ca3
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