Skip to content

Commit 3d1ad62

Browse files
committed
Merge branch '2.3-develop' of github.com:magento/magento2ce into EPAM-PR-19
2 parents d73110b + 7610692 commit 3d1ad62

File tree

34 files changed

+899
-89
lines changed

34 files changed

+899
-89
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ env:
3333
- TEST_SUITE=integration INTEGRATION_INDEX=2
3434
- TEST_SUITE=integration INTEGRATION_INDEX=3
3535
- TEST_SUITE=functional
36+
- TEST_SUITE=graphql-api-functional
3637
matrix:
3738
exclude:
3839
- php: 7.1
@@ -43,6 +44,8 @@ matrix:
4344
env: TEST_SUITE=js GRUNT_COMMAND=static
4445
- php: 7.1
4546
env: TEST_SUITE=functional
47+
- php: 7.1
48+
env: TEST_SUITE=graphql-api-functional
4649
cache:
4750
apt: true
4851
directories:
@@ -61,5 +64,6 @@ script:
6164

6265
# The scripts for grunt/phpunit type tests
6366
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
64-
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
67+
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js"] && [ $TEST_SUITE != "graphql-api-functional" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
6568
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi
69+
- if [ $TEST_SUITE == "graphql-api-functional" ]; then phpunit -c dev/tests/api-functional; fi

app/code/Magento/BundleGraphQl/Model/Resolver/BundleItemLinks.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Magento\BundleGraphQl\Model\Resolver;
99

10-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
10+
use Magento\Framework\Exception\LocalizedException;
1111
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1212
use Magento\BundleGraphQl\Model\Resolver\Links\Collection;
1313
use Magento\Framework\GraphQl\Config\Element\Field;
@@ -47,7 +47,7 @@ public function __construct(
4747
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
4848
{
4949
if (!isset($value['option_id']) || !isset($value['parent_id'])) {
50-
throw new GraphQlInputException(__('"option_id" and "parent_id" values should be specified'));
50+
throw new LocalizedException(__('"option_id" and "parent_id" values should be specified'));
5151
}
5252

5353
$this->linkCollection->addIdFilters((int)$value['option_id'], (int)$value['parent_id']);

app/code/Magento/BundleGraphQl/Model/Resolver/Options/Label.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Magento\BundleGraphQl\Model\Resolver\Options;
99

10-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
10+
use Magento\Framework\Exception\LocalizedException;
1111
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1212
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Deferred\Product as ProductDataProvider;
1313
use Magento\Framework\GraphQl\Config\Element\Field;
@@ -50,7 +50,7 @@ public function resolve(
5050
array $args = null
5151
) {
5252
if (!isset($value['sku'])) {
53-
throw new GraphQlInputException(__('"sku" value should be specified'));
53+
throw new LocalizedException(__('"sku" value should be specified'));
5454
}
5555

5656
$this->product->addProductSku($value['sku']);

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(array $typeResolvers = [])
3131
}
3232

3333
/**
34-
* {@inheritdoc}
34+
* @inheritdoc
3535
*/
3636
public function resolveType(array $data) : string
3737
{
@@ -42,10 +42,6 @@ public function resolveType(array $data) : string
4242
return $resolvedType;
4343
}
4444
}
45-
if (empty($resolvedType)) {
46-
throw new GraphQlInputException(
47-
__('Concrete type for %1 not implemented', ['ProductLinksInterface'])
48-
);
49-
}
45+
throw new GraphQlInputException(__('Cannot resolve layered filter type'));
5046
}
5147
}

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

Lines changed: 3 additions & 9 deletions
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
{
@@ -29,8 +29,7 @@ public function __construct(array $productLinksTypeNameResolvers = [])
2929
}
3030

3131
/**
32-
* {@inheritdoc}
33-
* @throws GraphQlInputException
32+
* @inheritdoc
3433
*/
3534
public function resolveType(array $data) : string
3635
{
@@ -48,11 +47,6 @@ public function resolveType(array $data) : string
4847
return $resolvedType;
4948
}
5049
}
51-
52-
if (!$resolvedType) {
53-
throw new GraphQlInputException(
54-
__('Concrete type for %1 not implemented', ['ProductLinksInterface'])
55-
);
56-
}
50+
throw new GraphQlInputException(__('Cannot resolve type'));
5751
}
5852
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Magento\CatalogGraphQl\Model\Resolver;
99

10-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
10+
use Magento\Framework\Exception\LocalizedException;
1111
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1212
use Magento\Catalog\Api\Data\CategoryInterface;
1313
use Magento\Catalog\Model\ResourceModel\Category\Collection;
@@ -85,7 +85,7 @@ public function __construct(
8585
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
8686
{
8787
if (!isset($value['model'])) {
88-
throw new GraphQlInputException(__('"model" value should be specified'));
88+
throw new LocalizedException(__('"model" value should be specified'));
8989
}
9090

9191
/** @var \Magento\Catalog\Model\Product $product */

app/code/Magento/CatalogGraphQl/Model/Resolver/Category/Breadcrumbs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Magento\CatalogGraphQl\Model\Resolver\Category;
99

1010
use Magento\CatalogGraphQl\Model\Resolver\Category\DataProvider\Breadcrumbs as BreadcrumbsDataProvider;
11-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
11+
use Magento\Framework\Exception\LocalizedException;
1212
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1313
use Magento\Framework\GraphQl\Config\Element\Field;
1414
use Magento\Framework\GraphQl\Query\ResolverInterface;
@@ -38,7 +38,7 @@ public function __construct(
3838
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
3939
{
4040
if (!isset($value['path'])) {
41-
throw new GraphQlInputException(__('"path" value should be specified'));
41+
throw new LocalizedException(__('"path" value should be specified'));
4242
}
4343

4444
$breadcrumbsData = $this->breadcrumbsDataProvider->getData($value['path']);

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

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

1010
use Magento\Catalog\Model\Product;
11+
use Magento\Framework\Exception\LocalizedException;
1112
use Magento\Framework\GraphQl\Config\Element\Field;
12-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1313
use Magento\Framework\GraphQl\Query\ResolverInterface;
1414
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1515

@@ -29,7 +29,7 @@ public function resolve(
2929
array $args = null
3030
) {
3131
if (!isset($value['model'])) {
32-
throw new GraphQlInputException(__('"model" value should be specified'));
32+
throw new LocalizedException(__('"model" value should be specified'));
3333
}
3434

3535
/* @var $product Product */

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Magento\CatalogGraphQl\Model\Resolver\Product;
99

10-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
10+
use Magento\Framework\Exception\LocalizedException;
1111
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1212
use Magento\Catalog\Api\Data\ProductInterface;
1313
use Magento\Catalog\Model\Product;
@@ -16,9 +16,9 @@
1616
use Magento\Framework\GraphQl\Query\ResolverInterface;
1717

1818
/**
19-
* Fixed the id related data in the product data
19+
* @inheritdoc
2020
*
21-
* {@inheritdoc}
21+
* Fixed the id related data in the product data
2222
*/
2323
class EntityIdToId implements ResolverInterface
2424
{
@@ -46,7 +46,7 @@ public function resolve(
4646
array $args = null
4747
) {
4848
if (!isset($value['model'])) {
49-
throw new GraphQlInputException(__('"model" value should be specified'));
49+
throw new LocalizedException(__('"model" value should be specified'));
5050
}
5151

5252
/** @var Product $product */

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,32 @@
77

88
namespace Magento\CatalogGraphQl\Model\Resolver\Product;
99

10-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
10+
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;
1415
use Magento\Framework\GraphQl\Query\ResolverInterface;
1516

1617
/**
18+
* @inheritdoc
19+
*
1720
* Format a product's media gallery information to conform to GraphQL schema representation
1821
*/
1922
class MediaGalleryEntries implements ResolverInterface
2023
{
2124
/**
25+
* @inheritdoc
26+
*
2227
* Format product's media gallery entry data to conform to GraphQL schema
2328
*
24-
* {@inheritdoc}
29+
* @param \Magento\Framework\GraphQl\Config\Element\Field $field
30+
* @param ContextInterface $context
31+
* @param ResolveInfo $info
32+
* @param array|null $value
33+
* @param array|null $args
34+
* @throws \Exception
35+
* @return array
2536
*/
2637
public function resolve(
2738
Field $field,
@@ -31,7 +42,7 @@ public function resolve(
3142
array $args = null
3243
) {
3344
if (!isset($value['model'])) {
34-
throw new GraphQlInputException(__('"model" value should be specified'));
45+
throw new LocalizedException(__('"model" value should be specified'));
3546
}
3647

3748
/** @var Product $product */

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,31 @@
77

88
namespace Magento\CatalogGraphQl\Model\Resolver\Product;
99

10-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
10+
use Magento\Framework\Exception\LocalizedException;
1111
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1212
use Magento\Catalog\Model\Product;
1313
use Magento\Framework\GraphQl\Config\Element\Field;
1414
use Magento\Framework\GraphQl\Query\ResolverInterface;
1515

1616
/**
17+
* @inheritdoc
18+
*
1719
* Format the new from and to typo of legacy fields news_from_date and news_to_date
1820
*/
1921
class NewFromTo implements ResolverInterface
2022
{
2123
/**
24+
* @inheritdoc
25+
*
2226
* Transfer data from legacy news_from_date and news_to_date to new names corespondent fields
2327
*
24-
* {@inheritdoc}
28+
* @param \Magento\Framework\GraphQl\Config\Element\Field $field
29+
* @param \Magento\Framework\GraphQl\Query\Resolver\ContextInterface $context
30+
* @param ResolveInfo $info
31+
* @param array|null $value
32+
* @param array|null $args
33+
* @throws \Exception
34+
* @return null|array
2535
*/
2636
public function resolve(
2737
Field $field,
@@ -31,7 +41,7 @@ public function resolve(
3141
array $args = null
3242
) {
3343
if (!isset($value['model'])) {
34-
throw new GraphQlInputException(__('"model" value should be specified'));
44+
throw new LocalizedException(__('"model" value should be specified'));
3545
}
3646

3747
/** @var Product $product */

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
namespace Magento\CatalogGraphQl\Model\Resolver\Product;
99

10-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
10+
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,
@@ -32,7 +41,7 @@ public function resolve(
3241
array $args = null
3342
) {
3443
if (!isset($value['model'])) {
35-
throw new GraphQlInputException(__('"model" value should be specified'));
44+
throw new LocalizedException(__('"model" value should be specified'));
3645
}
3746

3847
/** @var Product $product */

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
namespace Magento\CatalogGraphQl\Model\Resolver\Product;
99

10-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
10+
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,
@@ -59,7 +68,7 @@ public function resolve(
5968
array $args = null
6069
) {
6170
if (!isset($value['model'])) {
62-
throw new GraphQlInputException(__('"model" value should be specified'));
71+
throw new LocalizedException(__('"model" value should be specified'));
6372
}
6473

6574
/** @var Product $product */

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
namespace Magento\CatalogGraphQl\Model\Resolver\Product;
99

10+
use Magento\Framework\Exception\LocalizedException;
1011
use Magento\Framework\GraphQl\Config\Element\Field;
1112
use Magento\Framework\GraphQl\Query\ResolverInterface;
1213
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1314
use Magento\Catalog\Model\Product;
14-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1515
use Magento\Catalog\Helper\Output as OutputHelper;
1616

1717
/**
@@ -44,7 +44,7 @@ public function resolve(
4444
array $args = null
4545
): array {
4646
if (!isset($value['model'])) {
47-
throw new GraphQlInputException(__('"model" value should be specified'));
47+
throw new LocalizedException(__('"model" value should be specified'));
4848
}
4949

5050
/* @var $product Product */

0 commit comments

Comments
 (0)