Skip to content

Commit 96da3e3

Browse files
committed
getRootCategoryId returns a string, and getTree expected an int
1 parent 39ca723 commit 96da3e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException;
1414
use Magento\Framework\GraphQl\Query\ResolverInterface;
1515
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
16+
use Magento\GraphQl\Model\Query\ContextInterface;
1617

1718
/**
1819
* Category tree field resolver, used for GraphQL request processing.
@@ -64,7 +65,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
6465
}
6566

6667
$rootCategoryId = isset($args['id']) ? (int)$args['id'] :
67-
$context->getExtensionAttributes()->getStore()->getRootCategoryId();
68+
(int)$context->getExtensionAttributes()->getStore()->getRootCategoryId();
6869
$this->checkCategoryIsActive->execute($rootCategoryId);
6970

7071
$categoriesTree = $this->categoryTree->getTree($info, $rootCategoryId);

0 commit comments

Comments
 (0)