Amplify automatically generates mutations for delete like this:
export const deleteTodo = /* GraphQL */ `
mutation DeleteTodo($input: DeleteTodoInput!) {
deleteTodo(input: $input) {
index
body
hasRead
}
and this is how I call it in my App.js
await API.graphql(graphqlOperation(mutations.deleteTodo, {input: result}));
It returns an error like this. Seems like the data has not been passed
message: "The variables input contains a field name 'index' that is not defined for input object type 'DeleteTodoInput' "