Add support for checkpoint based pagination when fetching a list of clients
Changes
Based on the documentation it is possible to use the Query Parameters q, take and from for checkpoint based pagination. The problem was that the library doesn't support this yet. The next value won't be set. Overriding the existing constructor with one that sets the next parameter fixes this.
Testing
There is currently no test suite for checking if pagination is working. Manual Testing is possible by creating a ExtendedClientFilter (in my case i tested it with Kotlin) in your application:
class ExtendedClientFilter : ClientFilter() {
fun withFromAndTake(
from: String?,
take: Int,
): ClientFilter {
if (!from.isNullOrEmpty()) {
parameters["from"] = from
}
parameters["take"] = take
return this
}
}
Calling the .clients().list() function returns the next variable in the body.
- [X] This change has been tested on the latest version of the platform/language
Checklist
- [x] I have read the Auth0 general contribution guidelines
- [x] I have read the Auth0 Code of Conduct
- [X] All existing and new tests complete without errors
Hi @PhillipTr01
You’re right, currently the SDK doesn’t support checkpoint pagination properly because the next value isn’t set automatically when using q, from, and take. Overriding the constructor and extending to set those parameters manually works.
That said, there’s a minor refactoring in progress that will affect this endpoint. Once that lands, I’ll update the SDK to reflect the changes (including those related to this endpoint). I’ll keep you posted as things move forward.
Thanks again for raising the PR !!
Hey @tanya732, are there any updates on this pull request :)?