Skip to content
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

Expose the ability to generate cursors from records #32

Merged
merged 1 commit into from
Oct 31, 2018

Conversation

bernardd
Copy link
Contributor

This is a relatively minor change which exposes the ability to generate cursors for records other than the first/last in a page. You can already do this by calling Cursor.encode/1, but this provides an interface more consistent with the paginate/3 call (that is, specifying cursor fields as a list of atoms).

For some background, I'm working on using this library to provide cursor-based pagination through the GraphQL Relay Connection interface (via https://github.com/absinthe-graphql/absinthe_relay), and that requires the ability to attach a cursor to every item rather than just the first and last ones.

@stevedomin stevedomin merged commit adbabac into duffelhq:master Oct 31, 2018
@stevedomin
Copy link
Member

Thanks for the PR @bernardd!

@stevedomin
Copy link
Member

v0.5 is out with this change: https://hex.pm/packages/paginator/0.5.0

@bernardd bernardd deleted the expose-cursor-generation branch October 31, 2018 22:29
@bernardd
Copy link
Contributor Author

Awesome, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants