diff --git a/src/Provider/APIProvider.php b/src/Provider/APIProvider.php index fd05a10..1227566 100644 --- a/src/Provider/APIProvider.php +++ b/src/Provider/APIProvider.php @@ -14,6 +14,8 @@ use Bolt\Extension\Bolt\JsonApi\Storage\Query\Handler\PagingHandler; use Silex\Application; use Silex\ServiceProviderInterface; +use Bolt\Storage\Query\ContentQueryParser; + /** * Class APIProvider @@ -152,9 +154,13 @@ function ($classMetadata) use ($app) { } ); - $app['query.parser']->addDirectiveHandler('paginate', new PagerHandler()); - $app['query.parser']->addHandler('pager', new PagingHandler()); - $app['query.parser']->addOperation('pager'); + $app->extend('query.parser', function (ContentQueryParser $parser) { + $parser->addDirectiveHandler('paginate', new PagerHandler()); + $parser->addHandler('pager', new PagingHandler()); + $parser->addOperation('pager'); + + return $parser; + }); } /**