-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add support to skip queries #53
Comments
I'm not sure this is still relevant. There might be a case for lazy queries, but will investigate in the future. |
any update on lazy queries? TBH without lazy queries, it is completely unusable. |
Another use case for lazy queries: Apollo Client depends on a jwt token which is passed in headers so gql server can do row-level authorization. A lazy query lets you not only trigger a query based on a user action, but would let you react to the presence of another store like a $token or $user object which has it's own lifecycle. I'd go as far as to say it is equally as important as a query which runs during initialization, if not more. The library feels unfinished without a way to "updateClient" and no way to trigger a query/mutation whenever you want. Perhaps that's why we're not at a 1.0 release on npm. Is this library still under development? |
Actually, for anyone looking for lazy queries, you do not need an API exposed for this from
|
If I end up using this in the coming weeks and bulletproofing it, ill put up a PR to implement lazy queries. Edit: Will not be adding a PR, since I have decided to move to URQL for my needs, see next comment. But it should be easy to implement, see previous comment. |
The exact API requested by OP @marton987 is implemented in URQL (an alternative to Apollo that has official Svelte bindings), so might be worth a look there for anyone finding this closed thread in the future: https://formidable.com/open-source/urql/docs/basics/svelte/#queries |
Hi, can we have a parameter to skip a query depending on some conditionals to avoid undefined fetch?
Something similar to:
The text was updated successfully, but these errors were encountered: