Create a Custom Exchange for urql to Filter Out Mutations when Offline

InstructorKadi Kraman

Share this video with your friends

Send Tweet

We'll create an exchange that filters out mutations that are executed while the user is offline and map them to an error result. When the user tries to add or remove a bookmark when offline, show an informative alert message.

Resources: Authoring exchanges: https://formidable.com/open-source/urql/docs/advanced/authoring-exchanges/ Wonka: https://github.com/kitten/wonka

Checkpoint: Add an offline mutation exchange