Mutating Multiple Records
You can create multiple table records using Archie Core’s auto-generated GraphQL mutation operations.
In the following examples, we have a table called students, which contains fields and relations like firstName, email, age.
Create multiple records
Section titled “Create multiple records”Request
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 }}Response
{ "data": { "createStudentsMany": { "success": true } }}Create multiple records with variables
Section titled “Create multiple records with variables”Request
mutation MyMutation1 ( $inputs: [StudentsCreateInput!]!) { createStudentsMany( inputs: $inputs ) { success }}Variables
{ "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" } ]}Response
{ "data": { "createStudentsMany": { "success": true } }}