Skip to content

Help with keyset pagination for projects #808

Answered by louis-z
m-rusu asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @m-rusu,

The call to IProjectClient.GetAsync(ProjectQuery query) returns a GitLabCollectionResponse<Project>, which can be directly enumerated synchronously or asynchronously. Handling of GitLab pages is done under the hood, so you don't need to worry about accessing successive pages yourself. Specifying ProjectQuery.PerPage is not required (it will default to 20), but you may get better results in certain cases if you do.

For instance, say you wanted to get the first 83 projects. The optimal way would probably be to

  • tell GitLab you want 83-project pages, and
  • limit enumeration over the first 83 projects (i.e. the first page returned by GitLab):
var perPage = 83;
var query = new Proje…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by m-rusu
Comment options

You must be logged in to vote
0 replies
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