I'm using appSync with react-native, I have a mutation defined in my schema like this:
And it works fine when I test the mutation in the query section
The problem is that I'm not sure how to represent that with graphql-tag, I cannot figure it out how to pass the argument.
This is the representation I got:
This is how I call the mutation:
And this is the query definition, where vitals is and array
But the mutation does not execute, it rolls back. I only can see this:
Anyone can help me out??
Thanks in advance
You have declared a variable $vitals
but are not providing that key in variables
. You are setting variables with variables: initValues.vitals
where initValues.vitals
is the array of inputs that you want. You need to change it to variables: initValues
so vitals
remains a top level key that GraphQL can then find and replace the $vitals
variable with.
Let me know if this fixes your issue.