The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development. This plugin provides functionality for the API category, allowing for the creation and management of GraphQL and REST based backends for your amplify project.
I would like to request the addition of a totalCount field to the list***** queries in the amplify-category-api when using SQL Schema. Currently, when querying, we receive the limit, nextToken, filter, and items fields, but there is no way to know the total number of items that match the query criteria. Adding totalCount would provide this crucial piece of information, enhancing the ability to manage and paginate data more effectively.
I understand that totalCount is not possible in DDB schemas, but it would be nice if SQL schema could support this.
Describe the solution you'd like
The solution would involve modifying the listUsers query schema to include a totalCount field. This field should return the total number of users that match the query criteria, irrespective of the limit applied. An example of the updated query would be:
This change would greatly improve the usability of the API for applications that need to display or process large lists of users, enabling more informed pagination and data handling strategies.
Describe alternatives you've considered
The only option that I see is to recreate all list queries by myself and not make use of the autogenerated queries, which is a bit of an overhead.
Additional context
No response
Is this something that you'd be interested in working on?
[ ] 👋 I may be able to implement this feature request
Describe the feature you'd like to request
I would like to request the addition of a totalCount field to the list***** queries in the amplify-category-api when using SQL Schema. Currently, when querying, we receive the limit, nextToken, filter, and items fields, but there is no way to know the total number of items that match the query criteria. Adding totalCount would provide this crucial piece of information, enhancing the ability to manage and paginate data more effectively.
I understand that totalCount is not possible in DDB schemas, but it would be nice if SQL schema could support this.
Describe the solution you'd like
The solution would involve modifying the listUsers query schema to include a totalCount field. This field should return the total number of users that match the query criteria, irrespective of the limit applied. An example of the updated query would be:
With this enhancement, a typical response would look like:
This change would greatly improve the usability of the API for applications that need to display or process large lists of users, enabling more informed pagination and data handling strategies.
Describe alternatives you've considered
The only option that I see is to recreate all list queries by myself and not make use of the autogenerated queries, which is a bit of an overhead.
Additional context
No response
Is this something that you'd be interested in working on?
Would this feature include a breaking change?