4 ms·
One thing I'm wondering about graphql is how does it know when something changed in the db and should be re-queried. For example, I fetch some movies in my fron
by d0m 11y ago
One thing I'm wondering about graphql is how does it know when something changed in the db and should be re-queried. For example, I fetch some movies in my front-end webapp and they are cached. Then, later on, I query that movie again but something changed on the server, say the producer had a typo in their name. In that situation, it seems like graphql will only fetch the new fields I'm querying, and not what's already cached.
I understand it's a caching problem which is hard (I know that joke), but I'm wondering specifically how it's handled with a graph query.
The way I've been doing it is using a SQL structured on the front-end and downloading the main table/rows + changes. But graphql seems to be downloading and aggressively caching without keeping track of timestamp.
- andrewingram 11y agoGraphQL doesn't specify anything to do with caching. If you run the same query twice, they'll be fully evaluated each time. You can (and probably should) implement some caching, but it's up to you, and therefore cache invalidation is up to you too.
- deleted 11y ago[deleted]
- sebak 11y agoRelated: the meteor people announced they'll be working on this problem. http://info.meteor.com/blog/reactive-graphql http://info.meteor.com/blog/reactive-graphql