Skip to content

Commit

Permalink
Support maximumLimit in pagination
Browse files Browse the repository at this point in the history
At the moment, you can only change the maximum limit in the overall settings. This enables support for the maximumLimit setting per model.
  • Loading branch information
ec8or authored and GuySartorelli committed Aug 17, 2023
1 parent 2dff1e6 commit db1d6d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Schema/Plugin/PaginationPlugin.php
Expand Up @@ -88,7 +88,7 @@ public function apply(Field $field, Schema $schema, array $config = []): void

$defaultLimit = $config['defaultLimit'] ?? $this->config()->get('default_limit');
$connectionName = $config['connection'] ?? $plainType;
$max = $this->config()->get('max_limit');
$max = $config['maximumLimit'] ?? $this->config()->get('max_limit');
$limit = min($defaultLimit, $max);
$field->addArg('limit', "Int = $limit")
->addArg('offset', "Int = 0")
Expand Down

0 comments on commit db1d6d3

Please sign in to comment.