This course is no longer maintained and may be out-of-date. While it remains available for reference, its content may not reflect the latest updates, best practices, or supported features.
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.
Let's use optimistic updates for toggling and deleting todos.
We will learn the following concepts:
- Creating a GraphQL mutation
- Using the Mutation with $apollo.mutate
- Capturing loading/finished/error states
- Use optimistic responses
Let's get started!
Did you find this page helpful?
Start with GraphQL on Hasura for Free
Build apps and APIs 10x faster
Built-in authorization and caching
8x more performant than hand-rolled APIs

