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

Add pagination via a common library #6

Open
brent-hoover opened this issue Jun 13, 2024 · 7 comments
Open

Add pagination via a common library #6

brent-hoover opened this issue Jun 13, 2024 · 7 comments
Labels
feature New feature or request

Comments

@brent-hoover
Copy link
Contributor

brent-hoover commented Jun 13, 2024

Right now we expect every resolver to solve the problem of how to performantly paginate through large data sets. This should be something provided by the framework similar to how RC did it.

This package
looks interesting. Could also borrow stuff from RC but would need to adapt it for Mongoose/TypeGoose

@brent-hoover brent-hoover added the feature New feature or request label Jun 17, 2024
@aldeed
Copy link

aldeed commented Jun 20, 2024

From what I remember, the RC code could handle either cursor-based or page-based. It might be worth writing a new package that combines the one you link to with the RC approach. I could take a look at it since I wrote or reviewed most of the RC code.

@brent-hoover
Copy link
Contributor Author

@aldeed Yeah, I think that package also handles both cursor and page based. What features would be missing?

@aldeed
Copy link

aldeed commented Jun 25, 2024

Are you sure? The docs say

This module helps in implementing #2 - cursor based paging - by providing a method that make it easy to query within a Mongo collection.

@brent-hoover
Copy link
Contributor Author

@aldeed Yeah, you're right. I read that backwards thinking it did both offset and cursor but it only does cursor and I believe we would want both?

@aldeed
Copy link

aldeed commented Jun 27, 2024

I remember the general discussion with Reaction being that some frontend situations just don't work with cursor and others just don't work with offset, so we opted to support both. I believe there was a decision record about it. Obviously we don't have to, but if most of the hard coding work is done for it and can be adapted easily to mongoose, then it makes sense.

@brent-hoover
Copy link
Contributor Author

I think that makes sense. How do we want to structure this? All built into one package or with a few packages? I think I would tend to say just one package for simplicity sake

@aldeed
Copy link

aldeed commented Jul 1, 2024

Agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants