normalized-cache
normalized-cache copied to clipboard
Question: Is it possible to read all entries of a type?
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?
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 ;)
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?