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

Skip request #228

Closed
matheus-rosin opened this issue Apr 22, 2019 · 2 comments
Closed

Skip request #228

matheus-rosin opened this issue Apr 22, 2019 · 2 comments

Comments

@matheus-rosin
Copy link

Apollo has a feature called skip that, being a boolean, if true, will skip the query, for example. This would be awesome for Urql, specially because of the hooks approach.

If I use the component Query, I can check for myself if some needed variable is missing and, just return null in that case, for instance. But, if I were to reproduce this behavior using the useQuery hook, I would need to create a component (HOC) for returning null in order to skip the api request - but I would still be using the component approach, and the hook would lose sense.

So, what if we could pass an prop like skip, either using a component or a hook, that receives a boolean value, and that if true would skip of calling the api?

Thanks

@matheus-rosin
Copy link
Author

I made a PR for this. There are some checks to be made. Now it is up to you 🙂

@parkerziegler
Copy link
Contributor

Closed via #237.

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