I got the same error message on GraphQL mutation input object then I found the problem, Actually in my case mutation expecting an object array as input but I'm trying to insert a single object as input. For example:
First try
const mutationName = await apolloClient.mutate<insert_mutation, insert_mutationVariables>({
mutation: MUTATION,
variables: {
objects: {id: 1, name: "John Doe"},
},
});
Corrected mutation call as an array
const mutationName = await apolloClient.mutate<insert_mutation, insert_mutationVariables>({
mutation: MUTATION,
variables: {
objects: [{id: 1, name: "John Doe"}],
},
});
Sometimes simple mistakes like this can cause the problems. Hope this'll help someone.