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.
Github API documentation repeatedly emphasizes that one should not construct URLs when paginating, but use the ones provided.
The way I see it,
GHResult
should have anextPage: 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 amap
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, thennextPage
would beOption[MethodsFreeMonad]
. But I digress.