Feature: add MaxPages option to project queries #511
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the maximum of pages that will be traversed is set to a static value.
const PageNumberLimit = 2But for bigger projects and especially bigger teams, the traversal fetch of just two pages is not enough. For example if you want to calculate the velocity of the last 10 sprints in project x that contains y repositories, contributing z team members.
So I added in the query options of projects a
MaxPagestraversal option. This option replaces the staticPageNumberLimitin projects.In fact the user that created the query is in charge how many pages should be fetched.
If there are less pages available, the already existing code will break the loop.
Default value is set to 2
Max value is limited to 30
Sad that at the moment github
projectsV2does not support more features like sorting and filtering. Hopefully this code will be obsolete in future releases of github graphql.