-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Feature idea: conditional refetchQueries #2143
Comments
I am also experiencing the same thing. They are not errors and I still have the intended side effect; the yellow warning line is jut annoying :( |
hmm, this is an interesting issue. I'll see if I can improve this with the 2.0 or immediately following. Do you have a sample app / reproduction I can use to see this? |
@jbaxleyiii That would be fantastic, thank you. I don't have a sample app, but to reproduce just make some route-level components that use
Then refresh the app at different routes and the routes with refetchQueries for other routes will throw the errors. |
@trevordmiller so the warnings are there as a help to prevent things like one off spelling mistakes where you are trying to update a query but it doesn't exist yet. I think I understand the use case you have though to generically try and refetch a few possible queries even if they haven't been run yet. I think its probably best to remove the warning since the use case is more important to support than warnings for mistaken code |
The verbatim warning that it throws is:
I also think that just removing this warning will sort this because everything works fine and it doesn't stop or crash anything, it's just that the yellow warning line stacks up on React Native (iOS simulator). :) |
Fixed in what will be |
@jbaxleyiii Thank you so much! |
Currently, Apollo outputs a
unknown query with name {Query} asked to refetch
warning whenever a mutation is run that has arefetchQuery
that hasn't been run yet (which occurs often, since users can start on different routes).It would be great if
refetchQuery
only ran if the related query has already run at least once instead of showing this warning.I'm using the query name as a string for the
refetchQueries
arg like:The text was updated successfully, but these errors were encountered: