I have 2 queries: getGroups(): [Group]
and getGroup($id: ID!): Group
. One component first loads all groups using getGroups()
and then later on a different component needs to access a specific Group
data by ID.
I'd expect that Apollo's normalization would already have Group data in cache and would use it when getGroup($id: ID!)
query is executed, but that's not the case.
When I set cache-only
fetchPolicy nothing is returned. I can access the data using readFragment
, but that's not as flexible as just using a query.
Is there an easy way to make Apollo return the cached data from a different query as I would expect?