Skip to content

Commit 645cdd2

Browse files
author
Valeriy Nayda
committed
GraphQL-189: Replace GraphQlInputException on LocalizedException
-- fix static tests
1 parent ac93407 commit 645cdd2

File tree

11 files changed

+86
-18
lines changed

11 files changed

+86
-18
lines changed

app/code/Magento/CatalogGraphQl/Model/ProductLinkTypeResolverComposite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface;
1212

1313
/**
14-
* {@inheritdoc}
14+
* @inheritdoc
1515
*/
1616
class ProductLinkTypeResolverComposite implements TypeResolverInterface
1717
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
use Magento\Framework\GraphQl\Query\ResolverInterface;
1717

1818
/**
19-
* Fixed the id related data in the product data
20-
*
2119
* {@inheritdoc}
20+
*
21+
* Fixed the id related data in the product data
2222
*/
2323
class EntityIdToId implements ResolverInterface
2424
{

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

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

1010
use Magento\Framework\Exception\LocalizedException;
11+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
1112
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1213
use Magento\Catalog\Model\Product;
1314
use Magento\Framework\GraphQl\Config\Element\Field;
@@ -19,9 +20,17 @@
1920
class MediaGalleryEntries implements ResolverInterface
2021
{
2122
/**
23+
* {@inheritdoc}
24+
*
2225
* Format product's media gallery entry data to conform to GraphQL schema
2326
*
24-
* {@inheritdoc}
27+
* @param \Magento\Framework\GraphQl\Config\Element\Field $field
28+
* @param ContextInterface $context
29+
* @param ResolveInfo $info
30+
* @param array|null $value
31+
* @param array|null $args
32+
* @throws \Exception
33+
* @return array
2534
*/
2635
public function resolve(
2736
Field $field,

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,17 @@
1919
class NewFromTo implements ResolverInterface
2020
{
2121
/**
22+
* {@inheritdoc}
23+
*
2224
* Transfer data from legacy news_from_date and news_to_date to new names corespondent fields
2325
*
24-
* {@inheritdoc}
26+
* @param \Magento\Framework\GraphQl\Config\Element\Field $field
27+
* @param \Magento\Framework\GraphQl\Query\Resolver\ContextInterface $context
28+
* @param ResolveInfo $info
29+
* @param array|null $value
30+
* @param array|null $args
31+
* @throws \Exception
32+
* @return null|array
2533
*/
2634
public function resolve(
2735
Field $field,

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

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

1010
use Magento\Framework\Exception\LocalizedException;
11+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
1112
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1213
use Magento\Catalog\Model\Product;
1314
use Magento\Catalog\Model\Product\Option;
@@ -20,9 +21,17 @@
2021
class Options implements ResolverInterface
2122
{
2223
/**
24+
* {@inheritdoc}
25+
*
2326
* Format product's option data to conform to GraphQL schema
2427
*
25-
* {@inheritdoc}
28+
* @param \Magento\Framework\GraphQl\Config\Element\Field $field
29+
* @param ContextInterface $context
30+
* @param ResolveInfo $info
31+
* @param array|null $value
32+
* @param array|null $args
33+
* @throws \Exception
34+
* @return null|array
2635
*/
2736
public function resolve(
2837
Field $field,

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

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

1010
use Magento\Framework\Exception\LocalizedException;
11+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
1112
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1213
use Magento\Catalog\Model\Product;
1314
use Magento\Catalog\Pricing\Price\FinalPrice;
@@ -47,9 +48,17 @@ public function __construct(
4748
}
4849

4950
/**
51+
* {@inheritdoc}
52+
*
5053
* Format product's tier price data to conform to GraphQL schema
5154
*
52-
* {@inheritdoc}
55+
* @param \Magento\Framework\GraphQl\Config\Element\Field $field
56+
* @param ContextInterface $context
57+
* @param ResolveInfo $info
58+
* @param array|null $value
59+
* @param array|null $args
60+
* @throws \Exception
61+
* @return array
5362
*/
5463
public function resolve(
5564
Field $field,

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88
namespace Magento\CatalogGraphQl\Model\Resolver\Product;
99

1010
use Magento\Framework\Exception\LocalizedException;
11+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
1112
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1213
use Magento\Catalog\Model\Product;
1314
use Magento\Catalog\Model\ProductLink\Link;
1415
use Magento\Framework\GraphQl\Config\Element\Field;
1516
use Magento\Framework\GraphQl\Query\ResolverInterface;
1617

1718
/**
18-
* Format the product links information to conform to GraphQL schema representation
19-
*
2019
* {@inheritdoc}
20+
*
21+
* Format the product links information to conform to GraphQL schema representation
2122
*/
2223
class ProductLinks implements ResolverInterface
2324
{
@@ -27,9 +28,17 @@ class ProductLinks implements ResolverInterface
2728
private $linkTypes = ['related', 'upsell', 'crosssell'];
2829

2930
/**
31+
* {@inheritdoc}
32+
*
3033
* Format product links data to conform to GraphQL schema
3134
*
32-
* {@inheritdoc}
35+
* @param \Magento\Framework\GraphQl\Config\Element\Field $field
36+
* @param ContextInterface $context
37+
* @param ResolveInfo $info
38+
* @param array|null $value
39+
* @param array|null $args
40+
* @throws \Exception
41+
* @return null|array
3342
*/
3443
public function resolve(
3544
Field $field,

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,32 @@
88
namespace Magento\CatalogGraphQl\Model\Resolver\Product;
99

1010
use Magento\Framework\Exception\LocalizedException;
11+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
1112
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1213
use Magento\Catalog\Model\Product;
1314
use Magento\Catalog\Model\Product\TierPrice;
1415
use Magento\Framework\GraphQl\Config\Element\Field;
1516
use Magento\Framework\GraphQl\Query\ResolverInterface;
1617

1718
/**
18-
* Format a product's tier price information to conform to GraphQL schema representation
19-
*
2019
* {@inheritdoc}
20+
*
21+
* Format a product's tier price information to conform to GraphQL schema representation
2122
*/
2223
class TierPrices implements ResolverInterface
2324
{
2425
/**
26+
* {@inheritdoc}
27+
*
2528
* Format product's tier price data to conform to GraphQL schema
2629
*
27-
* {@inheritdoc}
30+
* @param \Magento\Framework\GraphQl\Config\Element\Field $field
31+
* @param ContextInterface $context
32+
* @param ResolveInfo $info
33+
* @param array|null $value
34+
* @param array|null $args
35+
* @throws \Exception
36+
* @return null|array
2837
*/
2938
public function resolve(
3039
Field $field,

app/code/Magento/DownloadableGraphQl/Model/Resolver/Product/DownloadableOptions.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\DownloadableGraphQl\Model\Resolver\Product;
99

1010
use Magento\Framework\Exception\LocalizedException;
11+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
1112
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1213
use Magento\Catalog\Model\Product;
1314
use Magento\Downloadable\Helper\Data as DownloadableHelper;
@@ -20,9 +21,9 @@
2021
use Magento\Framework\GraphQl\Query\ResolverInterface;
2122

2223
/**
23-
* Format for downloadable product types
24-
*
2524
* {@inheritdoc}
25+
*
26+
* Format for downloadable product types
2627
*/
2728
class DownloadableOptions implements ResolverInterface
2829
{
@@ -65,9 +66,17 @@ public function __construct(
6566
}
6667

6768
/**
69+
* {@inheritdoc}
70+
*
6871
* Add downloadable options to configurable types
6972
*
70-
* {@inheritdoc}
73+
* @param \Magento\Framework\GraphQl\Config\Element\Field $field
74+
* @param ContextInterface $context
75+
* @param ResolveInfo $info
76+
* @param array|null $value
77+
* @param array|null $args
78+
* @throws \Exception
79+
* @return null|array
7180
*/
7281
public function resolve(
7382
Field $field,

app/code/Magento/EavGraphQl/Model/Resolver/AttributeOptions.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(
4747
}
4848

4949
/**
50-
* @inheritDoc
50+
* @inheritdoc
5151
*/
5252
public function resolve(
5353
Field $field,
@@ -67,6 +67,8 @@ public function resolve(
6767
}
6868

6969
/**
70+
* Get entity type
71+
*
7072
* @param array $value
7173
* @return int
7274
* @throws LocalizedException
@@ -81,6 +83,8 @@ private function getEntityType(array $value): int
8183
}
8284

8385
/**
86+
* Get attribute code
87+
*
8488
* @param array $value
8589
* @return string
8690
* @throws LocalizedException
@@ -95,6 +99,8 @@ private function getAttributeCode(array $value): string
9599
}
96100

97101
/**
102+
* Get attribute options data
103+
*
98104
* @param int $entityType
99105
* @param string $attributeCode
100106
* @return array

0 commit comments

Comments
 (0)