Skip to content

Commit fe6dd4b

Browse files
committed
magento/graphql-ce#816: Root category ID
1 parent 96da3e3 commit fe6dd4b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
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;
1716

1817
/**
1918
* Category tree field resolver, used for GraphQL request processing.
@@ -64,7 +63,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
6463
return $value[$field->getName()];
6564
}
6665

67-
$rootCategoryId = isset($args['id']) ? (int)$args['id'] :
66+
$rootCategoryId = !empty($args['id']) ? (int)$args['id'] :
6867
(int)$context->getExtensionAttributes()->getStore()->getRootCategoryId();
6968
$this->checkCategoryIsActive->execute($rootCategoryId);
7069

0 commit comments

Comments
 (0)