yanyongyu / githubkit

The modern, all-batteries-included GitHub SDK for Python, including rest api, graphql, webhooks, like octokit!
MIT License
176 stars 25 forks source link

Feature: GraphQL Pagination #112

Closed tisonkun closed 2 months ago

tisonkun commented 3 months ago

Something like https://github.com/octokit/plugin-paginate-graphql.js

yanyongyu commented 3 months ago

I'm not familiar with GraphQL pagination queries, but I can give it a try 😄

tisonkun commented 3 months ago

@yanyongyu The main design of the SDK above is a convention:

        pageInfo {
          hasNextPage
          endCursor
        }

that the GraphQL query must have the pageInfo section. And it will extract the related fields to fulfill after: $cursor.

It should be possible for users to handle this iteration logic manually but an out-of-the-box API can help.

tisonkun commented 3 months ago

And here is the related GitHub docs: https://docs.github.com/en/graphql/guides/using-pagination-in-the-graphql-api

yanyongyu commented 3 months ago

After a deep understanding of octokit plugin paginate graphql, I'll record some key points and notes here: