Skip to content

PageInfo / Pagination #966

Answered by smyrick
ovu asked this question in Q&A
Dec 11, 2020 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hello @ovu!

GraphQL does not provide details on how to implement your schema. It just provides the tools to describe what inputs you accept as part of your API, the response you return, and allows clients to select what parts of the response they want. This means there is no paging in the language itself and would just be up to you to implement it however you want.

If you wanted to follow that pattern you have linked you could declare a function like so:

class Hero(val name: String) {
    fun friends(first: Int?, after: Int?): List<Hero> {
        // Your logic to call your other APIs or DB with inputs
    }
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@zahari-palazov-gorillas
Comment options

@smyrick
Comment options

Answer selected by smyrick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants