Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
GraphQl
Schema
Type
Output
ElementMapper
Formatter
ResolveType.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Framework\GraphQl\Schema\Type\Output\ElementMapper\Formatter
;
9
10
use
Magento\Framework\GraphQl\Config\Element\InterfaceType
;
11
use
Magento\Framework\GraphQl\Config\Element\TypeInterface
;
12
use
Magento\Framework\GraphQl\Schema\Type\OutputTypeInterface
;
13
use
Magento\Framework\GraphQl\Schema\Type\Output\ElementMapper\FormatterInterface
;
14
use
Magento\Framework\ObjectManagerInterface
;
15
19
class
ResolveType
implements
FormatterInterface
20
{
24
private
$objectManager;
25
29
public
function
__construct
(
ObjectManagerInterface
$objectManager)
30
{
31
$this->objectManager =
$objectManager
;
32
}
33
37
public
function
format
(
TypeInterface
$configElement,
OutputTypeInterface
$outputType) : array
38
{
39
$config
= [];
40
if
($configElement instanceof
InterfaceType
) {
41
$typeResolver = $this->objectManager->create($configElement->getTypeResolver());
42
$config
[
'resolveType'
] =
function
(
$value
) use ($typeResolver) {
43
return
$typeResolver->resolveType(
$value
);
44
};
45
}
46
47
return
$config
;
48
}
49
}
$objectManager
$objectManager
Definition:
bootstrap.php:17
$config
$config
Definition:
fraud_order.php:17
Magento\Framework\GraphQl\Schema\Type\Output\ElementMapper\FormatterInterface
Definition:
FormatterInterface.php:16
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Framework\GraphQl\Schema\Type\Output\ElementMapper\Formatter\ResolveType\__construct
__construct(ObjectManagerInterface $objectManager)
Definition:
ResolveType.php:29
Magento\Framework\GraphQl\Schema\Type\Output\ElementMapper\Formatter\ResolveType\format
format(TypeInterface $configElement, OutputTypeInterface $outputType)
Definition:
ResolveType.php:37
$value
$value
Definition:
gender.phtml:16
Magento\Framework\GraphQl\Schema\Type\Output\ElementMapper\Formatter\ResolveType
Definition:
ResolveType.php:19
Magento\Framework\GraphQl\Config\Element\TypeInterface
Definition:
TypeInterface.php:15
Magento\Framework\GraphQl\Schema\Type\Output\ElementMapper\Formatter
Definition:
Fields.php:8
Magento\Framework\GraphQl\Config\Element\InterfaceType
Definition:
InterfaceType.php:13
Magento\Framework\GraphQl\Schema\Type\OutputTypeInterface
Definition:
OutputTypeInterface.php:15