DEV Community

Discussion on: Implementing pagination with AWS AppSync

Collapse
sashrika profile image
Sashrika Waidyarathna

Such a brilliant work Brice. What is your opinion on showing the total number of pages? Can we know it before hand?

Collapse
onlybakam profile image
Brice Pellé Author

typically how you do this depends on the data source. With DynamoDB, this is not something that can be retried from the table directly. the best thing to do is to keep track of your count in a separate table. on way to do this is to use dynamodb streams.

Collapse
mujeex profile image
mujeex • Edited

Not being able to have the total count of your table being returned as part of your response object is one of dynamodb‘s biggest shortcomings till this day. There is a long trending issue that opened on GitHub trying to resolve this problem to which you can find the link here. You can find some work arounds implemented by other developers on the thread as well as mine which will be posted in a not too far distant future.