-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Appsync Graphql: Return totalCount #2901
Comments
Hi @FatimahSanni Are you writing your queries yourself? or are you using the cli/transformer? Having accurate counts is heavily dependent on the specific data source type used for a type and it is impacted by aspects like pagination, scan vs query. |
Hi @manueliglesias, thanks for the reply. I am not sure I get your question but here is the scenario. I write the schema, appsync generates the queries, mutations etc. DynamoDB is the data source. I have played around with queries on the Appsync console but totalCount is not a thing. I just can't get total count of all items out of the box or is there something I am missing? |
Thanks for the clarification, looks like this would have to be a feature request for the transformer, you can create on in the cli repo: https://github.com/aws-amplify/amplify-cli/issues/new?template=feature_request.md |
yeah, this issue is not documented and related to AppSync resolver and DynamoDB. It maybe good to add example or docs. |
In stackoverflow answer , someone told 「there is not good way 」 is this true ? |
This will likely be an expensive operation as it will somehow involve a "scan" unless the amplify team can find a way to keep a ledger with a count of created and deleted items. |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
It would be nice for AppSync Graphl queries to return total count of items especially because of the implicit limit in place.
Using the queries as is, one can't tell for sure what the total count of items are, so this information cannot even be provided to the end users e.g. we have 50 items in stock or we have 40 departments in an organization.
The text was updated successfully, but these errors were encountered: