Comments (3)
a dependency links the op (usually your viewmodel container) to the model. without flushing deps, your app won't ever know what got updated, and could update when one isn't required.
is your mutationhandler referencing all the ops that it will mutate? if not, that's usually how it goes stale (the mutation updates the underlying data, but the query hasn't been updated by the mutation).
the cachedResponse will always get removed if any of the underlying doc fields get changed. if we didn't cache, then the object would get recreated every time dispatch got called.
from cashay.
is your mutationhandler referencing all the ops that it will mutate? if not, that's usually how it goes stale (the mutation updates the underlying data, but the query hasn't been updated by the mutation).
Well the thing is I don't use mutation as a mean to return data in this case, I only use the invalidate function in the mutationHandler (which by the way is not working on master, and I made a PR to solve that, the 'this' keyword does not refer to the singleton which means this._willInvalidate... is never set to true).
This is brutal in a sense, but should get the job done while I work on better mutation handling.
the cachedResponse will always get removed if any of the underlying doc fields get changed. if we didn't cache, then the object would get recreated every time dispatch got called.
So the flushDependencies function removes the cachedResponse of a query that just fired... Meaning that if I query a list of post, get into a post detail view (so the list is not "observed" anymore it's in a different view) modify this post with a mutation that triggers a mutationHandler on the list query, it will trigger the exception (no matter what this mutationHandler does btw, since this happens after the exception). Will try to isolate a test case for you to grasp what's going on.
from cashay.
yeah, an example might be good. whenever dispatch is called, all the invalidated queries will get recalculated.
from cashay.
Related Issues (20)
- UMD distribution HOT 5
- Wires crossed with CachedQuery data objects HOT 3
- Delete mutations and their related queries HOT 13
- minor broken link
- Drop graphql HOT 3
- create cashay-server for realtime updates HOT 2
- Cashay v2 HOT 18
- need to wrap query/mutation code HOT 1
- mutation subfields when no mutationHandlers seen yet HOT 4
- Conditionally cached? HOT 2
- Conditionally cached? - part 2 HOT 8
- RFC: return cached data for a known type/id HOT 13
- Cannot read property 'length' of undefined HOT 4
- Cache went stale and wasn't recreated HOT 7
- Nested @live triggers empty query HOT 1
- mutation selectors should not include @live fields HOT 3
- minimizedQueryString is undefined HOT 3
- SSR Clarification HOT 2
- Emptying object selections HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cashay.