-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
More pagination options #34
Comments
We should definitely align with (or at least support) the Relay Cursor Connections Specification for this. Specifically... Also, re: adapter support -- Mongo is defs capable of this but (I believe) it requires the aggregation pipeline (which I think we always use anyway?). It's easier in PG but still requires window functions to support |
I know you're not a big fan, @JedWatson, but as in our other work, there probably is value in being compatible with Relay where possible. Currently there's a small but maybe important divergence here.. the Relay Cursor Spec insists that the
This was an intentional choice on the part of FB; it lets you, for example, use a (stringified) timestamp as a cursor when paginating though items ordered by time. Not sure if this makes any difference in practice for KS? Obviously IDs serialise to strings anyway, I just wonder if this might make the endpoint incompatible with some Relay tools when, otherwise, they would have worked. Somewhat related; the spec also indicates cursor values should be opaque. Many people do this just by base64 encoding the value they want to use. This isn't a compatibility issue; just something we might want to consider. |
It looks like there hasn't been any activity here in over 6 months. Sorry about that! We've flagged this issue for special attention. It wil be manually reviewed by maintainers, not automatically closed. If you have any additional information please leave us a comment. It really helps! Thank you for you contribution. :) |
We currently support two pagination options on List queries:
first: Int
(limits the number of items returned)skip: Int
(skips that many items from the start, based on the sort criteria)In addition, if we're hoping to get close to API-compatible with graph.cool / Prisma we should add support for additional pagination options in the List GraphQL APIs:
last: Int
(reverse offirst
)after: ID
(alternative toskip
, starts after the provided ID based on sort criteria)before: ID
(reverse ofafter
)I'm not sure if these are easy/possible to implement with MongoDB so it may be a Postgres-adapter specific thing.
The text was updated successfully, but these errors were encountered: