Optimistic UI updates after mutations

We can notice that there is a lag when users create a todo. We can also create UIs where the UI updates optimistically, assuming that the mutation will be successful.

To enable toggling between completed states, and to delete todos let's use optimistic updates when we run mutations!

We will learn the following concepts:

  • Creating a GraphQL mutation
  • Using the useMutation React hook
  • Integrating Optimistic UI Updates
  • Capturing loading/finished/error states

Let's get started!


Get Started with GraphQL Now

Hasura Cloud gives you a fully managed, production ready GraphQL API as a service to help you build modern apps faster.
Ready to get started?
Start for free on Hasura Cloud or you could contact our sales team for a detailed walk-through on how Hasura may benefit your business.
Stay in the know
Sign up for full access to our community highlights, new features, and occasional baby animal gifs! Oh, and we have a strict no-spam rule. โœŒ๏ธ