Skip to content

Commit a6d7d45

Browse files
author
Valeriy Nayda
committed
GraphQL-88: Small image URL added to the product data
-- change exception in image resolver
1 parent a4c941e commit a6d7d45

File tree

1 file changed

+2
-1
lines changed
  • app/code/Magento/CatalogGraphQl/Model/Resolver/Product

1 file changed

+2
-1
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Catalog\Helper\ImageFactory as CatalogImageHelperFactory;
1111
use Magento\Catalog\Model\Product;
1212
use Magento\Framework\GraphQl\Config\Element\Field;
13+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1314
use Magento\Framework\GraphQl\Query\ResolverInterface;
1415
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1516

@@ -43,7 +44,7 @@ public function resolve(
4344
array $args = null
4445
): array {
4546
if (!isset($value['model'])) {
46-
throw new \LogicException(__("Cannot resolve entity model"));
47+
throw new GraphQlInputException(__('"model" value should be specified'));
4748
}
4849
/** @var Product $product */
4950
$product = $value['model'];

0 commit comments

Comments
 (0)