setting max page limit for pagination via environment variable #1075
+139
−8
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.
Fixes #1050
Note: Documentation not added in this PR. ( currently pagination is a undocumented / beta feature )
How to test
Before changes
git checkout main && yarn && yarn build && mage -v && docker compose up
10
( 5 page max and 2 items in each page ). Even though max page is set to 20 in query, it will restrict to 5 as default behaviour.After changes
git checkout pagination/max-pages-configuration && yarn && yarn build && mage -v && docker compose up
16
( 8 page max set via environment variable and 2 items in each page ). Even though max page is set to 20 in query, it will restrict to 8 as the environment variable is set and honoured with new behaviour.