Skip to content

Edge issue with the new equatable/hashable algorithm #3602

@JOyo246

Description

@JOyo246

Summary

When a query has a named fragment and an inline fragment, the new equatable logic seems to break. Trying to track this down, and it looks like the error is that __selections is used for the equatable check, but __selections looks vastly different after adding in an additional inlineFragment.

Version

1.5.2

Steps to reproduce the behavior

Query: https://github.com/apollographql/apollo-ios-dev/blob/main/Sources/StarWarsAPI/starwars-graphql/HeroDetails.graphql + add in an inline fragment of your choice.

query HeroDetailsWithFragment($episode: Episode) {
  hero(episode: $episode) {
    ...HeroDetails
    ... on Human {
      mass
    }
  }
}

After generating, notice your diff changes from __mergedSources to __selections, where the new inline fragment's field is the only selection.

Now, when creating this object, the only field used for hashable/equatable is the field on the inlineFragment.

Image

Logs

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions