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.
mutation後の楽観的なUIの更新(Optimistic UI Updates)
ユーザーがtodoを作成した後にラグが発生した場合、気付くことができます。mutationが成功すると仮定して、楽観的なUIの更新が実行されるUIを構築することもできます。
完了ステータスの切り替えやtodoの削除を可能にするには、mutationを実行するときに楽観的な更新を使用します。
以下のコンセプトを学びます。
- GraphQL mutationの作成
useMutation
Reactフックの使用- 楽観的なUIの更新の組み込み
- 読み込み/終了/エラー状態のキャプチャ
始めましょう。
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

