I have a problem with Apollo GraphQL:
- I have a list
categoriesand everycategoryhas a list ofitems. - Every
categoryhas itsidand everyitemhas itsid. - When I pull the list of
categorieswith theiritems, I pull only theseitemswhich are available. - When I click an available
item, I need to pull thecategorydetails with itsitems, also the unavailable ones. - This unfortunately updates the
categorieslist with unavailable items.
I don't know how to separate list cache from the details cache. Unfortunately the objects are always updated.
Your type definitions have an ambiguity that the cache cannot deal with automatically. You can either (a) directly manipulate the cache to get the behavior you want (hard here actually) or (b) define a new field called
availableItemsundercategoriesthat only has available items.