Open brent-hoover opened 5 months ago
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.
@aldeed Yeah, I think that package also handles both cursor and page based. What features would be missing?
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.
@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?
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.
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
Agree
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