You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A major feature of data-fetching libraries is normalization. Existing data-fetching libraries have differing approaches to normalization:
Protocol-generic libraries such as react-query and swr use key-value caches, and by design, do not support normalization.
GraphQL libraries such as apollo-client and urql guarantee that the cached data is structured by nature of the type system, enabling them each to implement an easy-to-use normalized caching system.
rest-hooks is the most comparable data-fetching library, which implements a normalized cache for REST API data. As is evident in the API, this requires quite a bit of customization for the user to properly configure this, especially compared to the GraphQL libraries.
Goals
A normalized cache should be opt-in.
Non-normalized cached responses should behave exactly as they did before the cache was normalized.
A schema can optionally be provided when making any sort of request, indicating how it should be normalized and denormalized into the cache.
We could utilize normalizr under the hood, but need to provide customization for record merging.
The text was updated successfully, but these errors were encountered:
A major feature of data-fetching libraries is normalization. Existing data-fetching libraries have differing approaches to normalization:
react-query
andswr
use key-value caches, and by design, do not support normalization.apollo-client
andurql
guarantee that the cached data is structured by nature of the type system, enabling them each to implement an easy-to-use normalized caching system.rest-hooks
is the most comparable data-fetching library, which implements a normalized cache for REST API data. As is evident in the API, this requires quite a bit of customization for the user to properly configure this, especially compared to the GraphQL libraries.Goals
We could utilize
normalizr
under the hood, but need to provide customization for record merging.The text was updated successfully, but these errors were encountered: