Skip to content
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

Closed
ade-fatimah opened this issue Mar 20, 2019 · 7 comments
Closed

Appsync Graphql: Return totalCount #2901

ade-fatimah opened this issue Mar 20, 2019 · 7 comments
Labels
AppSync Related to AppSync issues GraphQL Related to GraphQL API issues question General question

Comments

@ade-fatimah
Copy link

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.

@manueliglesias
Copy link
Contributor

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.

@manueliglesias manueliglesias added question General question GraphQL Related to GraphQL API issues AppSync Related to AppSync issues labels Mar 20, 2019
@ade-fatimah
Copy link
Author

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?

@manueliglesias
Copy link
Contributor

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

@yareyaredesuyo
Copy link
Contributor

yeah, this issue is not documented and related to AppSync resolver and DynamoDB.

It maybe good to add example or docs.

@yareyaredesuyo
Copy link
Contributor

@julescsv
Copy link

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.

@github-actions
Copy link

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 *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AppSync Related to AppSync issues GraphQL Related to GraphQL API issues question General question
Projects
None yet
Development

No branches or pull requests

4 participants