Not sure this question makes sense but here goes a...
# apollo-kotlin
j
Not sure this question makes sense but here goes anyway!. I'm wondering about approaches to observing apollo cache etc in case where you have to make separate query for some list of data and then subsequent queries (for each element in list) for related data.....and want access to "flattened" version of data in ViewModel/Presenter etc. Seems like a few possibilities....can do likes of following for example in say a use case (from where we want to expose a flow) 1. query/observe list and then use
flatMapMerge
along, for each element in list,
combine
using flow returning queries for related data needed 2. query/observe list and just use
map
and then make "single shot queries" for data needed for each element Option 1 is more complicated of course but perhaps needed given nature of how we can potentially get multiple updates from queries (maybe from cache first and then network etc). Option 2 might work I guess if we knew data was in cache (or if we were say doing network only request). Anyway, just in case anyone has come across particular patterns for dealing with queries/data like this
❤️ 1
m
Not sure I get the use case 100%. You want to get both the list + per-item details at the same time? If yes, then make a big query containing everything? Or is latency a concern?
j
Not able in this case for it to be a single quey