I’m new to GraphQL and i’ve been implementing the “Relay Connection Specification” for doing cursor-based pagination on my backend. This works very well and I have easily achieved an “infinite scroll” using Apollo Client’s fetchMore
but there is one catch: mutations.
How are we, idiomatically, going to handle mutations such as an entry being deleted or updated? Do i have to do local mutations to the cache? Should i refetch that “page”, and if so, how do i know which cursor it was using? I just know the ID of the object being deleted.
A Facebook feed is a good example. If i go to my own feed and scroll far, far down and delete a post it will disappear. Same goes for edits, it just works. Doing local mutations to the cache seems repetetive & error-prone to me, but what are the alternatives (if any)?