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.
todoの削除 - mutation
ここでは、GraphQL Mutationsを使って既存のtodoを削除する方法を学びます。
todosへのmutationを行うためのgraphql queryを定義します。
mutation removeTodo ($id: Int!) {delete_todos(where: {id: {_eq: $id}}) {affected_rows}}
アプリケーションデータベースに対してGraphiQLでこのmutationを 試して 、どのような応答が得られるかを確認します。また、変数に値を渡す必要があります。
このgraphql mutationをReactアプリに組み込みましょう。
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

