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

refetchQueries fails if a query has not yet been executed #690

Closed
jasonphillips opened this issue Sep 21, 2016 · 2 comments
Closed

refetchQueries fails if a query has not yet been executed #690

jasonphillips opened this issue Sep 21, 2016 · 2 comments
Labels
Milestone

Comments

@jasonphillips
Copy link
Contributor

I'm running into a situation where this line throws an error by calling forEach on undefined:

https://github.com/apollostack/apollo-client/blob/master/src/QueryManager.ts#L1002

The situation emerges when I use the refetchQueries option on a mutation but have not yet (due to sometimes varied user paths to the mutation) fetched the particular query named.

It seems preferable to allow a list of invalidated queries to be provided without throwing an error when one hasn't been fetched yet; unless I'm missing something.

@helfer
Copy link
Contributor

helfer commented Sep 21, 2016

@jasonphillips yes, you're right, we should just ignore the query if it hasn't run yet, or maybe print a warning to the console just to help people discover typos.

@helfer
Copy link
Contributor

helfer commented Oct 24, 2016

I assume this is fixed now since we merged the PR. Please holler if that's not the case.

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

No branches or pull requests

3 participants