-
Notifications
You must be signed in to change notification settings - Fork 75
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 opaque cursor-based pagination #665
Comments
This came up again in the context of entities. It'd be useful to have cursor-based pagination for the infinite scroll of the entities table (getodk/central-frontend#741). Since we're planning to support entity deletion (#803), we can't use the same strategy for that infinite scroll as we do for the submissions table, which fetches chunks based on offsets. Deletion + offset-based pagination could result in entities being skipped in the infinite scroll:
Instead of using an offset, the infinite scroll could filter based on One idea for the cursor is for it to filter on |
There are a couple of ways to fetch submissions in chunks:
$top
and$skip
. However, it is difficult to use those to fetch only new submissions, because submissions are sorted bycreatedAt
descending, not ascending.createdAt
timestamp. The next time, use the$filter
OData query parameter to fetch submissions after that timestamp. However, this runs into OData filter: date/time fields more precise than millisecond #459.As an alternative to both of these, we could implement opaque cursor-based pagination. Quoting from https://graphql.org/learn/pagination/:
@lognaturel wrote about this concept:
At the moment, the main resource for which cursor-based pagination is of interest is submissions. However, at some point soon, we will face similar questions around entities.
The text was updated successfully, but these errors were encountered: