You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to docs, calling mutateUpdate* methods without passing additional parameters (like in the examples) should automatically update the data in the store without the need of a re-query.
I have strange results depending on where I run them.
Local machine:
calling mutate and then query with default caching will return the previous value.
calling mutate and then query with no-cache will return updated value
calling mutate and accessing object by using get will return object with old value
Stackblitz:
calling mutate and then query with default caching will return updated value.
calling mutate and then query with no-cache will return updated value
calling mutate and accessing object by using get will return object with old value
I would like to understand why the object is not updated in the store, as according to the docs it should be.
Also if someone could let me know why i have such a difference between stackblitz and my machine regarding the cached query it would be great.
The text was updated successfully, but these errors were encountered:
@ryskin Our solution (and I think the preferred official one) is to:
create a selector for the update with the updated fields
use the optimistic update to apply the update in the store
By using these two we are ok with our app. The update is immediate, when a query fails it's automatically reverted, the state of our store is the one we would expect to have.
Still, it's strange it does not work out of the box.
According to docs, calling mutateUpdate* methods without passing additional parameters (like in the examples) should automatically update the data in the store without the need of a re-query.
I have strange results depending on where I run them.
Local machine:
get
will return object with old valueStackblitz:
get
will return object with old valueHere's my example:
https://stackblitz.com/edit/jasmine-in-angular-ioexpj?file=src%2Flib%2Fdata-manager.service.spec.ts
I would like to understand why the object is not updated in the store, as according to the docs it should be.
Also if someone could let me know why i have such a difference between stackblitz and my machine regarding the cached query it would be great.
The text was updated successfully, but these errors were encountered: