mattkrick / cashay

:moneybag: Relay for the rest of us :moneybag:
MIT License
453 stars 28 forks source link

Support TTL on a per-field basis #23

Open mattkrick opened 8 years ago

mattkrick commented 8 years ago

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

mullender commented 8 years ago

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 :)