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
Our app is (as many ?) working with objects screen and dashboard with lists of those objects. Lists are quite big (~200/500 objects), and normalization brings a lot of issues:
performance issues, when reconstructing larges lists from the cache
cache miss issues, when fragments are not overlapping (e.g. fragments for the list and for the object are not a subset of each other) => cache is invalidated, and we have to refetch everything if we go from list => objects or objects => lists (both ways !)
It turns out normalization does not bring a lot in terms of performance/speed for queries with large lists, because we have to refetch the lists regularly anyway (if an item is added, etc.). Refetch queries or regular polling are relevant in many cases
What ?
We would like to have a way to disable normalization recursively for our list queries. We would like to keep the cache for those queries, but without border effects. The cache could store them as is, as a whole.
How ?
I tried to disable the normalization for our "ObjectConnection" for example, but "Object" is still normalized
The same behaviour could maybe be achieved with two apollo clients (one with normalization and one without) but I am not really sure on this, and it brings also its challenges
I am not sure exactly how this could be achieved technically, but I feel that in terms of API, it could be added to useQuery options, for example "disableNormalization" and then passed to InMemoryCache
Thank you !
The text was updated successfully, but these errors were encountered:
Another feature that we had to disable : prefetching data for the next screen :
When we are on a dashboard with large lists, we used to prefetch data of the next page on mouse hover, but a the list is reconstruted every time there is an update on any object of the list, the interface just freezes
=> the goal is really to have an apollo client that does not take into account lists when it comes to normalization
We've got a feature coming in 3.8 that allows you to use a @nonreactive directive to allow you to control when a parent component should rerender based on changes to the cache. This combined with useFragment is meant to help address performance concerns with large lists that may have lots of cache updates over time.
I'll leave this issue open, but I'd love for you to try out this solution once released to see if this helps address some of your concern.
Why ?
Our app is (as many ?) working with objects screen and dashboard with lists of those objects. Lists are quite big (~200/500 objects), and normalization brings a lot of issues:
It turns out normalization does not bring a lot in terms of performance/speed for queries with large lists, because we have to refetch the lists regularly anyway (if an item is added, etc.). Refetch queries or regular polling are relevant in many cases
What ?
We would like to have a way to disable normalization recursively for our list queries. We would like to keep the cache for those queries, but without border effects. The cache could store them as is, as a whole.
How ?
I tried to disable the normalization for our "ObjectConnection" for example, but "Object" is still normalized
The same behaviour could maybe be achieved with two apollo clients (one with normalization and one without) but I am not really sure on this, and it brings also its challenges
I am not sure exactly how this could be achieved technically, but I feel that in terms of API, it could be added to useQuery options, for example "disableNormalization" and then passed to InMemoryCache
Thank you !
The text was updated successfully, but these errors were encountered: