How do I prevent deleted records from appearing in my AWS Amplify GraphQL results?

Viewed 196

By default the Amplify GraphQL APIs return deleted items.

Worse, as near as I can tell there is apparently no way to filter them: Neither syncXYZTable nor listXYZTable queries accept the _deleted field as a parameter. Fortunately the generated code in the DataStore SDK filters out these items, and (somewhat confusingly) the Amplify Studio does not display them (in the Contents tab); but this only highlights the inconsistency: For example as a developer I don't see deleted items anywhere, but as a data scientist or manager using the GraphQL API, I have (it seems) no way of avoiding them.

Am I missing something. Is there really no way to filter out deleted items using the Amplify GraphQL API?

1 Answers

I had to filter these _deleted records in the code. Did not find a way to filter out in GraphQL Response

Related