-
-
Notifications
You must be signed in to change notification settings - Fork 36
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 cursor pagination #69
Conversation
Looks cool! Just a quick question, so instead of : film(pagination: { limit: 10, page: 0 }, orderBy: { title: ASC }) { we can now do: film(cursor: {limit: 5, cursor: "Int[4]:3361"}, orderBy: { title: ASC }) { am I right? |
@tyt2y3 but what about page pagination ? should we drop it ? |
8b7049b
to
7a9eb9c
Compare
I imagine both |
@tyt2y3 I found a way to unify both APIs. But we have braking changes because instead of PaginatedResult I return Connection (async_graphql builtin type that is compatible with Relay GraphQL spec https://relay.dev/graphql/connections.htm) |
No problem for a breaking change as long as we update all examples and docs. |
e2cdff2
to
2555cbe
Compare
* TODO: query before for more * TODO: query after for more
2555cbe
to
8bbc5fe
Compare
Updated documentation also SeaQL/seaql.github.io#58 |
Very cool! |
|
||
let stmt = #path::order_by(stmt, order_by); | ||
let cursor_string = CursorValues(values).encode_cursor(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey peeps, not sure if I understand the code here correctly. I think cursor should be constructed from values of sort by columns, not from PrimaryKey
like here.
For example, when you sort by name, price
then cursor should be combination of value of name and value of price
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @phungleson, currently, in seaography, we only support cursor pagination on primary key only.
@karatakis please correct me if I'm get it wrong.
PR Info
Closes Add cursor oriented pagination #19
Closes Cursor based pagination #58
Depends Re-export internal dependency instead of leaking it into user package #68
Adds
Breaking Changes