How to apply undo/redo functionality with Apollo Client?

I would like to apply undo/redo functionality in our application. Sadly after my research I didn’t find any use cases where this functionality (memento pattern) has been implemented in the Apollo.

I believe there is possibility to do it since Apollo is a state management after all.

I would appreciate your inputs pointing me to a use case or maybe walk me through the logic of applying such functionality the Apollo way

@malekzo there are a lot of different ways you could implement undo/redo patterns with Apollo Client, but quick question - what do you want to undo/redo? If it’s form changes for example, you’re probably better off just using something like Formik and Formik Undo. They’ll give you undo/redo out of the box, and can be used with Apollo Client.

1 Like

I would love to see this, too. Unfortunately this is rather difficult to implement with apollo cache.

There is e.g. this proposal