shurcooL / githubv4

Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://docs.github.com/en/graphql).
MIT License
1.11k stars 89 forks source link

Do I have to send multiple requests one by one to get all nodes? #29

Closed laike9m closed 6 years ago

laike9m commented 6 years ago

Say I'm fetching followers, using similar code as the pagination example. Now, if I have 600 followers, does it mean I have to send 6 requests to get them all? And it seems there's no way to parallelize it, since end cursor is needed to perform the next request?

dmitshur commented 6 years ago

Say I'm fetching followers, using similar code as the pagination example. Now, if I have 600 followers, does it mean I have to send 6 requests to get them all?

Yes, that's right. If the max page size is 100 followers, then you'll need to make 6 requests to fetch all 600 followers.

And it seems there's no way to parallelize it, since end cursor is needed to perform the next request?

Correct, you need to fetch the pages sequentially, as far as I know.

laike9m commented 6 years ago

Thanks for answering.