I'm trying to implement GraphQL filter using Amplify GraphQL Client. I got a list of todos and wanted to retrieve list of todos that has status complete.
The Documentation only show how to get all items and single item
const allTodos = await API.graphql(graphqlOperation(queries.listTodos));
console.log(allTodos);
Could someone please point me how to apply filter to the listTodos so that it return todos with status complete only.
I tried to do the following but it is wrong.
API.graphql(graphqlOperation(queries.listTodos(filter: {
status: {
eq: "completed"
}
})));