I wonder if anyone has any thoughts about migratio...
# apollo-kotlin
w
I wonder if anyone has any thoughts about migrations in Apollo. We’re using the normalized cache extensively, and the app relies on some data being available immediately, even if it’s not entirely up-to-date. This all works fine as long as we don’t modify the query for that data, but once we do, we have a cache miss and reach out to the network. That’s fine, but sometimes that initial request takes time or fails, and we end up with no data at all. I’m thinking about implementing some kind of migration, where the app would be made aware of new fields added for some objects, and it would manually save some default data in the cache. That way we’d avoid a cache miss if a field was added and the device is e.g. offline. Does that make any sense?
m
That's a cool idea. It'd be nice to have an index that stores the typename so that it's possible to lookup all the objects of a certain type without having to load all the DB
We have a remove(pattern) that can selectively remove based on an id pattern
If ids are like
"$typename:$id"
and we add a select(pattern) that could help
These are some big "ifs" though