DEV Community


Discussion on: GraphQL pagination with DynamoDB - Putting it together

arantespp profile image
Pedro Arantes

Hey @andyrichardsonn ! First, congratulations, I really appreciate the series, the way you wrote it, and the GIFs :)

Cursor-based pagination with DynamoDB is a topic I have an interest in because I work with it every day. I'd like to know if you have plans to create an NPM package for this method. I've created the dynamodb-cursor-based-pagination and I'm going to use some ideas of your code, like the exhaustQuery and passing documentClient as a parameter.

Tell me if you have plans to transform this into an NPM package, maybe we can work together.

andyrichardsonn profile image
Andy Richardson Author

Hey Pedro, thanks for the comment!

Feel free to use all/any of the code examples 👍 The project you have looks interesting and I'll definitely keep an eye on it!

I think one of the larger challenges with encapsulating pagination into a library is how much variance needs to be considered.

For example, there is some required domain/schema knowledge to be able to construct cursors, users might require (or want to avoid) calculating the hasPreviousPage value, and I'm sure there are a large number of additional edge cases (post-fetch filtering, etc).

It looks like you've already made a tonne of headway so maybe this is/could be a solved problem for those who have less exotic needs and are happy working within the constraints of a library 🚀