Open wellers opened 2 years ago
Ideally I'd like to run mutations like this:
mutation($input: people_insert_input!) {
people_insert(input: $input) {
success,
message
}
}
Passing variables like so:
{
"input": {
"people" : [{
"name": "Tom",
"age": 25
}]
}
}
But this also results in an error:
{
"errors": [
{
"message": "type 'List<dynamic>' is not a subtype of type 'List<Map<String, dynamic>>' of 'input'"
}
]
}
I've found that if I change my peopleInsertInput to:
final peopleInsertInput = inputObjectType("people_insert_input", inputFields: [
inputField("people", listOf(personInsertInput.nonNullable()))
]);
Mutations like this work now:
mutation {
people_insert(input: { people: [{ name: "Bob", age: 25 }]}) {
success,
message
}
}
But if I try to run mutations like this (passing in the $input type):
mutation($input: people_insert_input!) {
people_insert(input: $input) {
success,
message
}
}
I get a stack overflow exception on the GraphQL.makeLazy() method. Looks to be in an infinite loop in the recursive function.
Will take a look at this issue
I am trying to run mutations like the following, passing an array of objects in my input parameters:
I have defined my schema inputs and return objects like so:
And a mutation object for inserting like this:
When I run the above mutation I get the following response:
Have I missed something in my schema definitions or is this not possible yet?