ts-react-apollo icon indicating copy to clipboard operation
ts-react-apollo copied to clipboard

Bug when dealing with query skip option

Open rfbotto opened this issue 5 years ago • 1 comments

Problem

Currently, when using the skip option (https://www.apollographql.com/docs/react/essentials/queries.html#props) on a Query component, we get the console error : An unexpected Query sidecase happened where no valid union type could be found, please file an issue for this.

This happens since we are always expecting the query to actually have one of three state : loading, error or data, but when we pass skip the query doesn't actually get executed and we don't get any of these states which trigger the error log.

Expected behaviour

The query component should be able to support the skip option without throwing a console error, since it's also a valid state of the query.

rfbotto avatar Mar 05 '19 11:03 rfbotto