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
ここでは、完了した既存のtodoをGraphQL Mutationsを使って一括削除する方法を学びます。
todosへのmutationを行うためのgraphql queryを定義します。
mutation clearCompleted {delete_todos(where: {is_completed: {_eq: true}, is_public: {_eq: false}}) {affected_rows}}
また、variablesに値を渡す必要があります。
アプリケーションデータベースに対して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

