cashay
cashay copied to clipboard
Support TTL on a per-field basis
Every prop on the server GraphQL schema should be given a __ttl
field that is automatically requested by cashay. When received by the client, an expiresAt
field is generated on the parent object and the earliest time trickles up to the parent array and parent query, etc. It's run during the GC cycle, about every 5 mins. Removing it from normalized data, which invalidates the denormalized response and triggers a series of refreshes that only occur during a redux listener call, so thing out of the view stay deleted. That means no unnecessary data is fetched and we can store data in a persisted state. It also fails gradually, so it's "progressive"
CC @wenzowski
You could take a look at Falcor's expiration implementation ($expires
):
https://netflix.github.io/falcor/doc/global.html#Atom
Falcor does a lot of nice things :)