-
Notifications
You must be signed in to change notification settings - Fork 71
fix: SelectionSet
equality in 1.x
#771
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
base: v1
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for apollo-ios-docc canceled.
|
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 0 new, 3 changed, 0 removed
Build ID: f2e31548e29f16e8906b2e12 URL: https://www.apollographql.com/docs/deploy-preview/f2e31548e29f16e8906b2e12 |
__data[key] | ||
} | ||
|
||
public static func == (lhs: MockSelectionSet, rhs: MockSelectionSet) -> Bool { |
There was a problem hiding this comment.
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.
52a7915
to
893a4f5
Compare
87a2466
to
ab8f785
Compare
There was a problem hiding this 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
} | ||
} | ||
|
||
@_disfavoredOverload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accidentally left this in when I was trying something else. We can remove the @_disfavoredOverload
here
await fulfillment(of: [updateCompletedExpectation], timeout: 1.0) | ||
} | ||
|
||
func test__equatable__givenFailingModelFromCI_sameValue_shouldBeEqual() throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change the name of this to what it's actually testing, which I'm pretty sure is list of nested entities. We could probably remove the irrelevant fields also.
This is related to apollographql/apollo-ios#3579 but targets a fix in the 1.0 branch.
An
Optional
type wrapped byAnyHashable
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 usingAnyHashable
inDataDict
and then cast the field data as the field's concrete type for equality checks.