OneGraph / graphiql-explorer

Explorer plugin for GraphiQL
MIT License
907 stars 97 forks source link

issue while rendering union types #26

Open rikinsk opened 5 years ago

rikinsk commented 5 years ago

There seems to be an issue while rendering Union type fields in the explorer

eg:

union UserResult = User | GenericError | IsSuspended

type User {
  id ID!
}

type GenericError {
  type: String!
  message: String!
  field: String
}

type IsSuspended {
  message: String!
}

type Query {
  current_user: UserResult!
}

in the Explorer when you select the query current_user it will give you the list in the union, User & GenericError will select and you can see the object structure, but if you try IsSuspended it will not show you the object structure.

This behaviour changes based on whether if you make message as String! vs String hence I believe there seems to be some issue while dealing with nullability of the fields.

Originally reported at: https://github.com/hasura/graphql-engine/issues/3101