-
Notifications
You must be signed in to change notification settings - Fork 223
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
Allow simple limit / offset pagination #247
Comments
Quoting the docs:
What's really going on with You should not worry about it being a string, since:
import { offsetToCursor } from 'graphql-relay'
let cursor = offsetToCursor(9)
// jump straight to page 3!
let query = `{
user(id: 1) {
posts(first: 5, after: "${cursor}") {
pageInfo {
endCursor
}
total
edges {
node { body }
}
}
}
}` I hope I've answered your question. |
For anyone not using Relay but still wanting simple LIMIT / OFFSET, here's an example (rather rough) dialect you can use/modify to do that: |
I tried to use LIMIT / OFFSET using the first / after arguments for simple pagination, but it's not currently possible with mariadb. Currently, 'after' accepts only a string cursor, but it should also accept an integer for SQL offset.
The text was updated successfully, but these errors were encountered: