normalized-cache icon indicating copy to clipboard operation
normalized-cache copied to clipboard

Question: Is it possible to read all entries of a type?

Open waspeer opened this issue 3 years ago • 2 comments

I was playing around with this library as a way to normalize the data I fetch with react-query. I was not able to figure out a way to read all entries of the same type. Is that possible atm?

waspeer avatar May 13 '21 07:05 waspeer

Hi! There is indeed currently no public API to read all entries of the same type. Could you explain a bit about the use case? You could however peek into the cache._entities object if you are just playing around.

PS: This library has never been used by anybody to my knowledge so use at own risk ;)

boschni avatar May 13 '21 11:05 boschni

Cool! I was trying to use it to normalize data I queried from a GraphQL api. I was able to store a list of entities and their relations perfectly, but when I wanted to retrieve a list of all the entities of a specific type I got stuck. The library is looking really good btw! I really like the api and ease of use. What is the use-case it was designed for?

waspeer avatar May 31 '21 08:05 waspeer