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

Docs/Feat: Query order matters #430

Open
frandiox opened this issue Oct 23, 2018 · 0 comments
Open

Docs/Feat: Query order matters #430

frandiox opened this issue Oct 23, 2018 · 0 comments
Labels

Comments

@frandiox
Copy link
Contributor

frandiox commented Oct 23, 2018

Hi! I realized that queries are fired depending on the order they are provided to component.apollo, which is completely fine in most cases. However, when using apollo-link-state, it might be useful to run local queries earlier since they are synchronous (or seems to be).

I was fetching a todo list but had some filter applied to the query. This filter is a string and lives in apollo-link-state, so the component needs to get this filter as well. When order was apollo: { todos:{}, filter: {} }, I had 2 network requests for the todos: one without filter and another one with filter. When order is apollo: { filter:{}, todos: {} }, there is only 1 request directly with the filter applied.

Of course, this can be prevented by using skip and perhaps an additional flag or something. I just thought that it could be useful to write it here and either add this information to the docs or run local queries first.

Thanks!

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

No branches or pull requests

2 participants