-
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
client#query doesn't return updated data after performing a mutation #162
Comments
Hey, right now the recommended pattern is to call
I'm also working on documenting a better way to get refetches after a mutation, because right now that's not clear at all. I'm planning on documenting how to use Going to close this because I think the other issues cover the stuff you brought up - let me know if there is something I missed, and please post on there if you have thoughts about how these should be implemented! |
Thanks @stubailo!! Sure.. would do so... |
For now I have a simple schema. And in connectors I used mongoose to deal with mongodb.
At client side I simply do:
Lets assume that initial user fetched has
fullName
asName One
. Now, if I run a mutationI see that
subs#next
is called twice. Both the time it printsName One
in the console. Then I find the response of the mutation call being printed withfullName
asName Two
. Now, even if I callclient#query
onuser(mobileNum: "${mobileNum}")
, it returnsName One
. But, if I callsubs.refetch()
, local store is updated. Bothquery
andwatchQuery
are now printingName Two
.Is there something that I'm doing wrong? Would appreciate your help in debugging this issue.
The text was updated successfully, but these errors were encountered: