n1ru4l/graphql-live-query

Figure out how to optimize list changes

Closed this issue · 3 comments

When publishing a new value through the live query observable list updates cause the whole list to re-render. Also, the old records seem not to be evicted properly from the relay store.

I also tried converting the list to a Connection in order to see whether it is handled better.

https://github.com/n1ru4l/graphql-live-queries/compare/connection-test

Seems like this case could be optimized by merging the results smarter:

https://github.com/facebook/relay/blob/c37a30de8636f7380e5a41dee046f548428497e9/packages/relay-runtime/handlers/connection/ConnectionHandler.js#L186-L188

This was actually just a false alarm from the react-dev tools adding console.log into the fragment components showed that the components are not re-rendering.