-
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
refetchQueries with string arguments not updating component #1561
Comments
refetchQueries takes a query object, I don't think u can actually pass a string to it. |
@saudpunjwani101 The documentation on refetchQueries says it can take an array of either strings or objects (and the first example uses the string option). |
Yeah ur right, although the query does re execute it's not resolving the updates. I'll try it |
@dmarkow could you provide a reproduction for this? |
I just tried to reproduce this on the current version and can't, so maybe it was resolved with some of the recent updates... Thanks! |
Might be related to the race-condition described in #1821. |
I've just come across the same issue as @dmarkow. Object format |
I'm seeing the same behaviour @jpikora, passing the query document works but passing the operation name as a Array doesn't update the cache. |
Any update on this? I still can't pass string arguments to refetchQueries, as they don't seem to update the cache. Apollo client v2.6.8 |
Intended outcome:
Given a query:
Using
refetchQueries: ["AllUsers"]
in a mutation should re-execute the query and update any components depending on that query.Actual outcome:
While the query is re-executed, the component never updates. Using the apollo dev tools in Chrome, I can see the new User item listed in the store, but it never makes it to my component.
If I instead import the original query variable and use
refetchQueries: [{query: AllUsersQuery}]
, everything works as expected.How to reproduce the issue:
Use string arguments in
refetchQueries
The text was updated successfully, but these errors were encountered: