Skip to content

2.0 - SelectionSet Equatable crash when comparing objects #3587

@AnthonyMDev

Description

@AnthonyMDev

Summary

Taken from this comment in 2.0 megathread

@ppmtrifork says:

I found another issue, this time causing a crash. It happens when attempting to access the hashValue or comparing two instances of a SelectionSet that contain a Field with .object type.

This is the error message:

Thread 1: Fatal error: Expected object data for object field: Field(name: "statusLabel", alias: nil, arguments: nil, type: ApolloAPI.Selection.Field.OutputType.object(GraphQL.ListItemFragment.StatusLabel))
This is the schema for that object:

type ListItem implements Hashable & IComponent {
  action: Action
  hashCode: Int!
  label: String
  primary: String!
  secondary: String
  statusLabel: StatusLabel
  tertiary: String
  thumbnailURL: String
}

type StatusLabel {
  context: SeverityContext!
  text: String!
}

enum SeverityContext {
  ...
}

Any thoughts on what might be causing this?

Version

2.0 beta 2

Steps to reproduce the behavior

I've been able to reproduce it whenever I have a comparison between two SelectionSet matching that criteria, or even comparing against nil, and also when accessing hashValue.

Metadata

Metadata

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions