Skip to content

Commit 96f8ded

Browse files
committed
MC-32387: Add pagination support to categoryList query
1 parent ba7b269 commit 96f8ded

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\CatalogGraphQl\Model\Resolver;
99

1010
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ExtractDataFromCategoryTree;
11+
use Magento\Framework\Exception\InputException;
1112
use Magento\Framework\GraphQl\Config\Element\Field;
1213
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1314
use Magento\Framework\GraphQl\Query\ResolverInterface;
@@ -68,7 +69,11 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
6869
$args['filters']['ids'] = ['eq' => $store->getRootCategoryId()];
6970
}
7071

71-
$filterResult = $this->categoryFilter->getResult($args, $store);
72+
try {
73+
$filterResult = $this->categoryFilter->getResult($args, $store);
74+
} catch (InputException $e) {
75+
throw new GraphQlInputException(__($e->getMessage()));
76+
}
7277

7378
$rootCategoryIds = $filterResult['category_ids'];
7479
$filterResult['items'] = $this->fetchCategories($rootCategoryIds, $info);

0 commit comments

Comments
 (0)