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 committed Feb 9, 2023
1 parent 82a2262 commit 6d2817c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Schema/Plugin/PaginationPlugin.php
Original file line number Diff line number Diff line change
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 6d2817c

Please sign in to comment.