recently I started working on GraphQL, I am able to insert data in flat schema without any problem but when it comes to an Array of data I am getting an error like
I ran into the same problem - I did not know how to specify array of objects in the input definition. So for those who wants to see a "text" schema solution:
type Book {
title: String!
}
to have an array of Books in your input type
input AuthorInput {
name: String!
age: Int!
}
you can not just add books: [Book!]
inside the input statement, you will need deliberately create input type containing needed fields (duplicate if you like):
input BookInput {
title: String!
}
and then you can:
input AuthorInput {
name: String!
age: Int!
books: [BookInput!]
}