複数のレコードの変更
Archie Core の自動生成された GraphQL ミューテーション操作を使用して、複数のテーブルレコードを作成できます。
次の例では、firstName、email、age などのフィールドとリレーションを含む students というテーブルがあります。
複数のレコードの作成
Section titled “複数のレコードの作成”リクエスト
mutation MyMutation1 { createStudentsMany( inputs: [ { firstName: "Michael", lastName: "Jones", email: "michael.jones@example.com" , age: 24 city: "2900562f-d036-486d-be98-9ebf064c27fe" } { firstName: "William", lastName: "Miller", email: "william.miller@example.com" , age: 23 city: "fd880601-8732-4b1b-a42d-4170ef9cc485" } ] ) { success }}レスポンス
{ "data": { "createStudentsMany": { "success": true } }}変数を使用した複数のレコードの作成
Section titled “変数を使用した複数のレコードの作成”リクエスト
mutation MyMutation1 ( $inputs: [StudentsCreateInput!]!) { createStudentsMany( inputs: $inputs ) { success }}変数
{ "inputs": [ { "firstName": "Michael", "lastName": "Jones", "email": "michael.jones@example.com" , "age": 24, "city": "2900562f-d036-486d-be98-9ebf064c27fe" }, { "firstName": "William", "lastName": "Miller", "email": "william.miller@example.com" , "age": 23, "city": "fd880601-8732-4b1b-a42d-4170ef9cc485" } ]}レスポンス
{ "data": { "createStudentsMany": { "success": true } }}