How to update query results in state
Currently, our default update event handler for subscribeToMore in our query hooks apply updates from update events to all query results in state. The handler uses the document's primary key to find its updates.
How should we handle updates that cause the document in query result state to fall outside the query search parameters?
Options
- Allow the result to remain in the state which we currently support.
- Remove documents from the state as soon as they fall outside search parameters
What is the impact of these two?
We could also allow the user to choose which option to use.
cc @wtrocki @kingsleyzissou
The handler uses the document's primary key to find its updates.
That is the key problem (as also primary key changes). We should stop using primary key can filtering individual changes
Also this will help to avoid unneded complexity like ID_SWAP event type etc.