Skip to content

Commit 24b3dfe

Browse files
committed
MC-36456: union implementation
1 parent 9625a34 commit 24b3dfe

File tree

14 files changed

+20
-18
lines changed

14 files changed

+20
-18
lines changed

app/code/Magento/GraphQl/etc/schema.graphqls

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ directive @resolver(class: String="") on QUERY
3535
| INPUT_OBJECT
3636
| INPUT_FIELD_DEFINITION
3737

38-
directive @typeResolver(class: String="") on INTERFACE | OBJECT | UNION
38+
directive @typeResolver(class: String="") on UNION
39+
| INTERFACE
40+
| OBJECT
3941

4042
directive @cache(cacheIdentity: String="" cacheable: Boolean=true) on QUERY
4143

lib/internal/Magento/Framework/GraphQl/Query/Resolver/Argument/SearchCriteria/ArgumentApplier/Filter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(
5151
}
5252

5353
/**
54-
* {@inheritdoc}
54+
* @inheritDoc
5555
*/
5656
public function applyArgument(
5757
SearchCriteriaInterface $searchCriteria,

lib/internal/Magento/Framework/GraphQl/Query/Resolver/Argument/SearchCriteria/ArgumentApplier/Sort.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(SortOrderBuilder $sortOrderBuilder = null)
3333
}
3434

3535
/**
36-
* {@inheritdoc}
36+
* @inheritDoc
3737
*/
3838
public function applyArgument(
3939
SearchCriteriaInterface $searchCriteria,

lib/internal/Magento/Framework/GraphQl/Schema/Type/Output/ElementMapper/Formatter/Interfaces.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(OutputMapper $outputMapper)
3232
}
3333

3434
/**
35-
* {@inheritDoc}
35+
* @inheritDoc
3636
*/
3737
public function format(ConfigElementInterface $configElement, OutputTypeInterface $outputType) : array
3838
{

lib/internal/Magento/Framework/GraphQl/Schema/Type/Output/ElementMapper/Formatter/ResolveType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(ObjectManagerInterface $objectManager)
3333
}
3434

3535
/**
36-
* {@inheritDoc}
36+
* @inheritDoc
3737
*/
3838
public function format(ConfigElementInterface $configElement, OutputTypeInterface $outputType) : array
3939
{

lib/internal/Magento/Framework/GraphQl/Schema/Type/Output/ElementMapper/Formatter/Unions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(OutputMapper $outputMapper)
3232
}
3333

3434
/**
35-
* {@inheritDoc}
35+
* @inheritDoc
3636
*/
3737
public function format(ConfigElementInterface $configElement, OutputTypeInterface $outputType) : array
3838
{

lib/internal/Magento/Framework/GraphQl/Schema/Type/Output/ElementMapper/FormatterComposite.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\GraphQl\Schema\Type\OutputTypeInterface;
1212

1313
/**
14-
* {@inheritdoc}
14+
* @inheritDoc
1515
*/
1616
class FormatterComposite implements FormatterInterface
1717
{
@@ -29,7 +29,7 @@ public function __construct(array $formatters)
2929
}
3030

3131
/**
32-
* {@inheritDoc}
32+
* @inheritDoc
3333
*/
3434
public function format(ConfigElementInterface $configElement, OutputTypeInterface $outputType) : array
3535
{

lib/internal/Magento/Framework/GraphQlSchemaStitching/GraphQlReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function __construct(
7171
}
7272

7373
/**
74-
* @inheritdoc
74+
* @inheritDoc
7575
*
7676
* @param string|null $scope
7777
* @return array

lib/internal/Magento/Framework/GraphQlSchemaStitching/GraphQlReader/Reader/EnumType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(
3030
}
3131

3232
/**
33-
* @inheritdoc
33+
* @inheritDoc
3434
*/
3535
public function read(\GraphQL\Type\Definition\Type $typeMeta) : array
3636
{

lib/internal/Magento/Framework/GraphQlSchemaStitching/GraphQlReader/Reader/InputObjectType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(
4949
}
5050

5151
/**
52-
* @inheritdoc
52+
* @inheritDoc
5353
*/
5454
public function read(\GraphQL\Type\Definition\Type $typeMeta) : array
5555
{

lib/internal/Magento/Framework/GraphQlSchemaStitching/GraphQlReader/Reader/InterfaceType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(
4949
}
5050

5151
/**
52-
* @inheritdoc
52+
* @inheritDoc
5353
*/
5454
public function read(\GraphQL\Type\Definition\Type $typeMeta) : array
5555
{

lib/internal/Magento/Framework/GraphQlSchemaStitching/GraphQlReader/Reader/ObjectType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function __construct(
6969
}
7070

7171
/**
72-
* @inheritdoc
72+
* @inheritDoc
7373
*/
7474
public function read(\GraphQL\Type\Definition\Type $typeMeta) : array
7575
{

lib/internal/Magento/Framework/GraphQlSchemaStitching/GraphQlReader/Reader/UnionType.php

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

5151
/**
52-
* @inheritdoc
52+
* @inheritDoc
5353
*/
5454
public function read(\GraphQL\Type\Definition\Type $typeMeta) : array
5555
{
@@ -62,9 +62,9 @@ public function read(\GraphQL\Type\Definition\Type $typeMeta) : array
6262
'types' => $types,
6363
];
6464

65-
$unionResolveType = $this->getUnionTypeResolver($typeMeta);
66-
if (!empty($unionResolveType)) {
67-
$result['typeResolver'] = $unionResolveType;
65+
$unionTypeResolver = $this->getUnionTypeResolver($typeMeta);
66+
if (!empty($unionTypeResolver)) {
67+
$result['typeResolver'] = $unionTypeResolver;
6868
}
6969

7070

lib/internal/Magento/Framework/GraphQlSchemaStitching/GraphQlReader/TypeReaderComposite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(
2525
}
2626

2727
/**
28-
* {@inheritdoc}
28+
* @inheritDoc
2929
*/
3030
public function read(\GraphQL\Type\Definition\Type $typeMeta) : array
3131
{

0 commit comments

Comments
 (0)