Closed aim2120 closed 3 weeks ago
Thanks for raising the issue @aim2120. Are you using the hash value from an operation directly that you noticed this?
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.
@aim2120, the change is merged and will go out in the next release.
Hey @calvincestari, thanks for getting that updated! Yes, I was using the hash value in an interceptor implementation when I noticed the behavior.
Question
I recently discovered that
GraphQLOperation
hashing does not differentiate operations as much as I thought it would. In fact, if two operations both have no variables, they have the same hash value, even if they're entirely different operation types.This is due to the way
hash(into:)
is implemented forGraphQLOperation
This seems like an unfortunate design decision. A few questions for the maintainers of the project:
I've already updated my usage of the hash value based on this finding, but wanted to create an issue in case it may affect others.