Skip to content

Commit 7e06871

Browse files
author
Eric Bohanon
committed
MAGETWO-83872: Write metadata service
1 parent 508d3a9 commit 7e06871

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

app/code/Magento/Eav/Test/Unit/Model/TypeLocatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function setUp()
4242
$this->customAttributeTypeLocator = $this->objectManger->getObject(
4343
TypeLocator::class,
4444
[
45-
'complexTypeLocator' => $this->complexType
45+
'typeLocators' => [$this->complexType]
4646
]
4747
);
4848
}
@@ -109,7 +109,7 @@ public function getTypeDataProvider()
109109
'attributeCode' => null,
110110
'serviceClass' => $serviceInterface,
111111
'serviceEntityTypeMapData' => [$serviceInterface => $eavEntityType],
112-
'expected' => 'mixed'
112+
'expected' => 'anyType'
113113
],
114114
];
115115
}

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

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

77
namespace Magento\GraphQl\Model\Type;
88

9-
use Magento\Framework\GraphQl\Type\Definition\ListOfType;
10-
use Magento\Framework\GraphQl\Type\Definition\NonNull;
9+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1110
use Magento\Framework\GraphQl\Type\Definition\Type;
12-
use Magento\Framework\Exception\LocalizedException;
1311
use Magento\GraphQl\Model\Type\Handler\Pool;
1412
use Magento\Framework\GraphQl\Type\TypeFactory;
1513

@@ -52,7 +50,7 @@ public function generateTypes(string $typeName)
5250
{
5351
$types = [];
5452
if (!isset($this->typeMap[$typeName])) {
55-
throw new LocalizedException(__('Invalid GraphQL query name.'));
53+
throw new GraphQlInputException(__('Invalid GraphQL query name.'));
5654
}
5755
/** @var HandlerInterface $handler */
5856
foreach ($this->typeMap['types'] as $handler) {

app/code/Magento/Webapi/Test/Unit/Model/Rest/Swagger/GeneratorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ protected function setUp()
7474
->will($this->returnValue(self::OPERATION_NAME));
7575

7676
$this->customAttributeTypeLocatorMock = $this->getMockBuilder(
77-
\Magento\Framework\Webapi\CustomAttributeTypeLocatorInterface::class
78-
)->disableOriginalConstructor()
79-
->getMock();
77+
\Magento\Framework\Webapi\CustomAttribute\ServiceTypeListInterface::class
78+
)->disableOriginalConstructor()->setMethods(['getDataTypes'])
79+
->getMockForAbstractClass();
8080
$this->customAttributeTypeLocatorMock->expects($this->any())
81-
->method('getAllServiceDataInterfaces')
82-
->willReturn(['$customAttributeClass']);
81+
->method('getDataTypes')
82+
->willReturn(['customAttributeClass']);
8383

8484
$storeMock = $this->getMockBuilder(
8585
\Magento\Store\Model\Store::class
@@ -113,7 +113,7 @@ function ($value) {
113113
'cache' => $this->cacheMock,
114114
'typeProcessor' => $this->typeProcessorMock,
115115
'serviceMetadata' => $this->serviceMetadataMock,
116-
'customAttributeTypeLocator' => $this->customAttributeTypeLocatorMock,
116+
'serviceTypeList' => $this->customAttributeTypeLocatorMock,
117117
'authorization' => $authorizationMock,
118118
'serializer' => $this->serializer
119119
]

lib/internal/Magento/Framework/GraphQl/Type/Definition/BooleanType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* Wrapper for GraphQl BooleanType
1111
*/
12-
class BooleanType extends \GraphQL\Type\Definition\BooleanType implements ScalarTypeInterface
12+
class BooleanType extends \GraphQL\Type\Definition\BooleanType implements TypeInterface
1313
{
1414

1515
}

lib/internal/Magento/Framework/GraphQl/Type/Definition/FloatType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* Wrapper for GraphQl FloatType
1111
*/
12-
class FloatType extends \GraphQL\Type\Definition\FloatType implements ScalarTypeInterface
12+
class FloatType extends \GraphQL\Type\Definition\FloatType implements TypeInterface
1313
{
1414

1515
}

lib/internal/Magento/Framework/GraphQl/Type/Definition/IdType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* Wrapper for GraphQl IdType
1111
*/
12-
class IdType extends \GraphQL\Type\Definition\IdType implements ScalarTypeInterface
12+
class IdType extends \GraphQL\Type\Definition\IdType implements TypeInterface
1313
{
1414

1515
}

0 commit comments

Comments
 (0)