Skip to content

Endless scrolling in React Native - rerenders entire list #1020

Answered by kitten
Svarto asked this question in Q&A
Discussion options

You must be logged in to vote

This is expected behaviour; each time a query is made against Graphcache it has to walk its normalized data and constructs a new result from scratch, as if it was basically queried anew against a server.

That also means that all data will essentially not have the same references as before. Unintuitively this is much faster than preserving any instances due to the data structure that is needed to store normalized data. They're simply consistent of records and links between entities.

What we'd have to do if we wanted to preserve previous structure is to do a lot of deep comparisons. However, because this adds an added non-trivial cost it doesn't make much sense for urql to do this globally …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Svarto
Comment options

Answer selected by Svarto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants