diff --git a/vendor/magento/module-catalog-graph-ql/Model/Resolver/CategoryList.php b/vendor/magento/module-catalog-graph-ql/Model/Resolver/CategoryList.php index 747e05806a8..d4347f12bda 100644 --- a/vendor/magento/module-catalog-graph-ql/Model/Resolver/CategoryList.php +++ b/vendor/magento/module-catalog-graph-ql/Model/Resolver/CategoryList.php @@ -75,6 +75,10 @@ class CategoryList implements ResolverInterface } try { $processedArgs = $this->argsSelection->process($info->fieldName, $args); + // CategoryList query doesn't have pagination and should return all data. + // Otherwise, the default page size will be set. + $processedArgs['pageSize'] = 0; + $processedArgs['currentPage'] = 0; $filterResults = $this->categoryFilter->getResult($processedArgs, $store, [], $context); $rootCategoryIds = $filterResults['category_ids']; @@ -97,9 +101,6 @@ class CategoryList implements ResolverInterface $fetchedCategories = []; foreach ($categoryIds as $categoryId) { $categoryTree = $this->categoryTree->getTree($info, $categoryId); - if (empty($categoryTree)) { - continue; - } $fetchedCategories[] = current($this->extractDataFromCategoryTree->execute($categoryTree)); }