Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when dealing with query skip option #1

Open
rfbotto opened this issue Mar 5, 2019 · 1 comment
Open

Bug when dealing with query skip option #1

rfbotto opened this issue Mar 5, 2019 · 1 comment

Comments

@rfbotto
Copy link
Member

rfbotto commented Mar 5, 2019

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.

@nikgraf
Copy link
Contributor

nikgraf commented Mar 5, 2019

We could enhance it to return a different type including this 4th state when skip is set.

An alternative would be to simply not allow skip and refer to using the original Query component from Apollo like we do for notifyOnNetworkStatusChange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants