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

Pagination API is flawed #389

Open
dcsobral opened this issue Mar 25, 2020 · 1 comment
Open

Pagination API is flawed #389

dcsobral opened this issue Mar 25, 2020 · 1 comment

Comments

@dcsobral
Copy link
Contributor

dcsobral commented Mar 25, 2020

Github API documentation repeatedly emphasizes that one should not construct URLs when paginating, but use the ones provided.

Note: It's important to form calls with Link header values instead of constructing your own URLs. Link Header

Always rely on these link relations provided to you. Don't try to guess or construct your own URL. Basics of Pagination

The way I see it, GHResult should have a nextPage: Option[() => GHResponse accessor.

On a minor note, I sometimes feel limited by not having methods such as listPullRequest be part of the algebra as free monads, so that they could be passed around, and modified elsewhere. For example, I'm doing some stuff that requires extra headers, and I'd much rather do a map at the application entry point over the whole thing than change every call to include an optional map. If such an approach had been taken, then nextPage would be Option[MethodsFreeMonad]. But I digress.

@kalexmills
Copy link
Contributor

Related to #169

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

No branches or pull requests

2 participants