Skip to content

Commit a279d9c

Browse files
author
Eric Bohanon
committed
Merge remote-tracking branch 'remotes/origin/MAGETWO-83859-MetadataService-Attribute-Type-Resolver' into MAGETWO-83872-Implement-Metadata-Service
2 parents d6a86cb + 93ec9f5 commit a279d9c

32 files changed

+47
-74
lines changed

app/code/Magento/GraphQl/Controller/GraphQl.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ public function dispatch(RequestInterface $request)
9292
);
9393
} catch (\Exception $error) {
9494
$result['extensions']['exception'] = $this->graphQlError->create($error);
95-
$this->response->setStatusCode(500);
9695
}
9796
$this->response->setBody($this->jsonSerializer->serialize($result))->setHeader(
9897
'Content-Type',

app/code/Magento/GraphQl/Model/SchemaGenerator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
use GraphQl\Type\Definition\ResolveInfo;
1010
use Magento\Framework\GraphQl\Type\SchemaFactory;
11-
use Magento\Framework\GraphQl\Type\Schema;
1211
use Magento\GraphQl\Model\Type\Generator;
1312
use Magento\Framework\GraphQl\ArgumentFactory;
1413
use Magento\Framework\GraphQl\Type\TypeFactory;

app/code/Magento/GraphQl/Model/Type/Generator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
namespace Magento\GraphQl\Model\Type;
88

99
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
10-
use Magento\Framework\GraphQl\Type\Definition\Type;
1110
use Magento\GraphQl\Model\Type\Handler\Pool;
1211
use Magento\Framework\GraphQl\Type\TypeFactory;
12+
use Magento\Framework\GraphQl\Type\Definition\TypeInterface;
1313

1414
/**
1515
* {@inheritdoc}
@@ -83,7 +83,7 @@ public function generateTypes(string $typeName)
8383
*
8484
* @param string $argumentName
8585
* @param string $argumentType
86-
* @return Type
86+
* @return TypeInterface|\GraphQL\Type\Definition\Type
8787
*/
8888
private function decorateType(string $argumentName, string $argumentType)
8989
{

app/code/Magento/GraphQl/Model/Type/Handler/AttributeInput.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace Magento\GraphQl\Model\Type\Handler;
88

9-
use Magento\Framework\GraphQl\Type\Definition\InputObjectType;
109
use Magento\GraphQl\Model\Type\HandlerInterface;
1110
use Magento\Framework\GraphQl\Type\TypeFactory;
1211

app/code/Magento/GraphQl/Model/Type/Handler/ConfigurableProduct.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
namespace Magento\GraphQl\Model\Type\Handler;
88

9-
use Magento\Framework\GraphQl\Type\Definition\ListOfType;
10-
use Magento\Framework\GraphQl\Type\Definition\ObjectType;
119
use Magento\GraphQl\Model\Type\HandlerInterface;
1210
use Magento\Framework\GraphQl\Type\TypeFactory;
1311

app/code/Magento/GraphQl/Model/Type/Handler/CustomAttributeMetadata.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66

77
namespace Magento\GraphQl\Model\Type\Handler;
88

9-
use Magento\Framework\GraphQl\Type\Definition\ListOfType;
10-
use Magento\Framework\GraphQl\Type\Definition\ObjectType;
119
use Magento\GraphQl\Model\Type\HandlerInterface;
1210
use Magento\Framework\GraphQl\Type\TypeFactory;
11+
use Magento\Framework\GraphQl\Type\Definition\TypeInterface;
1312

1413
/**
1514
* Defines type information for custom attribute metadata
@@ -54,7 +53,7 @@ public function getType()
5453
/**
5554
* Get and register array of fields for CustomAttributeMetadata type
5655
*
57-
* @return array
56+
* @return TypeInterface[]
5857
*/
5958
private function getFields(): array
6059
{

app/code/Magento/GraphQl/Model/Type/Handler/Pool.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ public function __construct(
4949
}
5050

5151
/**
52-
* Get a Type
52+
* Get a type of @see TypeInterface or scalar native GraphQL
5353
*
5454
* @param string $typeName
55-
* @return TypeInterface
55+
* @return TypeInterface|\GraphQL\Type\Definition\Type
5656
* @throws \LogicException
5757
*/
5858
public function getType(string $typeName)
@@ -73,7 +73,7 @@ public function getType(string $typeName)
7373
* Retrieve type's configuration based off name
7474
*
7575
* @param string $typeName
76-
* @return TypeInterface|null
76+
* @return TypeInterface
7777
* @throws \LogicException Type Handler could not be found, and type does not exist in registry
7878
*/
7979
public function getComplexType(string $typeName)

app/code/Magento/GraphQl/Model/Type/Handler/Product.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66

77
namespace Magento\GraphQl\Model\Type\Handler;
88

9-
use Magento\Framework\GraphQl\Type\Definition\InterfaceType;
10-
use Magento\Framework\GraphQl\Type\Definition\Type;
119
use Magento\Eav\Api\AttributeManagementInterface;
1210
use Magento\Framework\Exception\InputException;
1311
use Magento\GraphQl\Model\Type\Helper\ServiceContract\TypeGenerator;
1412
use Magento\GraphQl\Model\Type\HandlerInterface;
1513
use Magento\Framework\GraphQl\Type\TypeFactory;
1614

1715
/**
18-
* Define Product's GraphQL type
16+
* Define product's GraphQL type
1917
*/
2018
class Product implements HandlerInterface
2119
{
@@ -92,7 +90,7 @@ public function getType()
9290
* Retrieve Product base fields
9391
*
9492
* @param string $typeName
95-
* @return Type[]
93+
* @return array
9694
* @throws \LogicException Schema failed to generate from service contract type name
9795
*/
9896
private function getFields(string $typeName)

app/code/Magento/GraphQl/Model/Type/Handler/ProductAttributeSearchCriteria.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
namespace Magento\GraphQl\Model\Type\Handler;
88

9-
use Magento\Framework\GraphQl\Type\Definition\InputObjectType;
10-
use Magento\Framework\GraphQl\Type\Definition\Type;
119
use Magento\Eav\Api\AttributeManagementInterface;
1210
use Magento\GraphQl\Model\Type\Helper\ServiceContract\TypeGenerator;
1311
use Magento\GraphQl\Model\Type\HandlerInterface;
@@ -65,7 +63,7 @@ public function getType()
6563
/**
6664
* Retrieve fields
6765
*
68-
* @return Type[]
66+
* @return \Closure|array
6967
*/
7068
private function getFields()
7169
{

app/code/Magento/GraphQl/Model/Type/Handler/ProductGroupSearchCriteria.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
namespace Magento\GraphQl\Model\Type\Handler;
88

9-
use Magento\Framework\GraphQl\Type\Definition\InputObjectType;
10-
use Magento\Framework\GraphQl\Type\Definition\Type;
119
use Magento\GraphQl\Model\Type\Helper\ServiceContract\TypeGenerator;
1210
use Magento\GraphQl\Model\Type\HandlerInterface;
1311
use Magento\Framework\GraphQl\Type\TypeFactory;
@@ -54,7 +52,7 @@ public function getType()
5452
/**
5553
* Retrieve Product base fields
5654
*
57-
* @return Type[]
55+
* @return array
5856
*/
5957
private function getFields()
6058
{

0 commit comments

Comments
 (0)