Skip to content

How could I paginate GraphQL calls? #1479

Answered by timrogers
Brend-Smits asked this question in Q&A
Discussion options

You must be logged in to vote

👋🏻 Hi @Brend-Smits! We don't have any functionality built into Octokit.rb for GraphQL or especially GraphQL pagination. As you've spotted, you can make a GraphQL request from Octokit, but it doesn't really go any further than that.

I don't have any sample code for that - but in principle, you need to take the endCursor returned and pass it in to the discussions connection using the after param - and just keep looping until hasNextPage is false.

I hope that helps! Happy to assist if you run into any issues, and it would be fantastic if you could share any code you wrote.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Brend-Smits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants