Skip to content

Commit 69f9ef2

Browse files
author
Alex Paliarush
committed
MAGETWO-82543: Create Webonyx wrappers
1 parent fd79ac9 commit 69f9ef2

25 files changed

+98
-45
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Magento\Framework\Serialize\SerializerInterface;
1414
use Magento\Framework\Webapi\Response;
1515
use Magento\GraphQl\Model\SchemaGeneratorInterface;
16-
use Magento\Framework\GraphQl\Executor;
16+
use Magento\Framework\GraphQl\RequestProcessor;
1717
use Magento\Framework\GraphQl\ExceptionFormatter;
1818

1919
/**
@@ -37,9 +37,9 @@ class GraphQl implements FrontControllerInterface
3737
private $jsonSerializer;
3838

3939
/**
40-
* @var Executor
40+
* @var RequestProcessor
4141
*/
42-
private $graphQlExecutor;
42+
private $requestProcessor;
4343

4444
/** @var ExceptionFormatter */
4545
private $graphQlError;
@@ -48,20 +48,20 @@ class GraphQl implements FrontControllerInterface
4848
* @param Response $response
4949
* @param SchemaGeneratorInterface $schemaGenerator
5050
* @param SerializerInterface $jsonSerializer
51-
* @param Executor $graphQlExecutor
51+
* @param RequestProcessor $requestProcessor
5252
* @param ExceptionFormatter $graphQlError
5353
*/
5454
public function __construct(
5555
Response $response,
5656
SchemaGeneratorInterface $schemaGenerator,
5757
SerializerInterface $jsonSerializer,
58-
Executor $graphQlExecutor,
58+
RequestProcessor $requestProcessor,
5959
ExceptionFormatter $graphQlError
6060
) {
6161
$this->response = $response;
6262
$this->schemaGenerator = $schemaGenerator;
6363
$this->jsonSerializer = $jsonSerializer;
64-
$this->graphQlExecutor = $graphQlExecutor;
64+
$this->requestProcessor = $requestProcessor;
6565
$this->graphQlError = $graphQlError;
6666
}
6767

@@ -83,7 +83,7 @@ public function dispatch(RequestInterface $request)
8383
throw new LocalizedException(__('Request content type must be application/json'));
8484
}
8585
$schema = $this->schemaGenerator->generate();
86-
$result = $this->graphQlExecutor->execute(
86+
$result = $this->requestProcessor->process(
8787
$schema,
8888
isset($data['query']) ? $data['query'] : '',
8989
null,

app/code/Magento/GraphQl/Model/Resolver/CustomAttributeMetadata.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ class CustomAttributeMetadata implements ResolverInterface
3030
private $typeProcessor;
3131

3232
/**
33-
* Initialize dependencies.
34-
*
3533
* @param TypeLocatorInterface $typeLocator
3634
* @param TypeProcessor $typeProcessor
3735
*/

app/code/Magento/GraphQl/Model/Resolver/Product.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function resolve(array $args)
7171
}
7272

7373
/**
74-
* Resolve product by Sku
74+
* Get product data by Sku
7575
*
7676
* @param string $sku
7777
* @return array|null
@@ -88,7 +88,7 @@ public function getProduct(string $sku)
8888
}
8989

9090
/**
91-
* Resolve product by Id
91+
* Get product data by Id
9292
*
9393
* @param int $productId
9494
* @return array|null
@@ -105,7 +105,7 @@ public function getProductById(int $productId)
105105
}
106106

107107
/**
108-
* Retrieve single product data in array format
108+
* Transform single product data from object to in array format
109109
*
110110
* @param \Magento\Catalog\Api\Data\ProductInterface $productObject
111111
* @return array|null

app/code/Magento/GraphQl/Model/Resolver/Products.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ class Products implements ResolverInterface
2020
*/
2121
private $productRepository;
2222

23-
/** @var Builder */
23+
/**
24+
* @var Builder
25+
*/
2426
private $searchCriteriaBuilder;
2527

2628
/**

app/code/Magento/GraphQl/Model/Resolver/Products/FindArgument/ClauseConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private function getCatalogProductFields()
132132
}
133133

134134
/**
135-
* Get a connective filter from an AST
135+
* Get a connective filter from an AST input
136136
*
137137
* @param string $entityType
138138
* @param array $arguments

app/code/Magento/GraphQl/Model/Resolver/Products/FindArgument/ValueParser.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Magento\Framework\GraphQl\Argument\Find\FindArgumentValueFactory;
99
use Magento\Framework\GraphQl\Argument\ValueParserInterface;
1010

11+
/**
12+
* Parses a mixed value to a FindArgumentValue
13+
*/
1114
class ValueParser implements ValueParserInterface
1215
{
1316
/** @var ClauseConverter */

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

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

99
/**
10-
* Retrieve resolve function for GraphQL type
10+
* Data retriever for field with arguments used in a GraphQL resolver when a query is processed
1111
*/
1212
interface ResolverInterface
1313
{
1414
/**
15-
* Parse arguments and resolve to data array
15+
* Parse arguments of a field and convert them to an array structure
1616
*
1717
* @param \Magento\Framework\GraphQl\ArgumentInterface[] $args
1818
* @return array|null

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ class AttributeInput implements HandlerInterface
2020
private $typePool;
2121

2222
/**
23-
* Initialize dependencies
24-
*
2523
* @param Pool $typePool
2624
*/
2725
public function __construct(Pool $typePool)

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ class CustomAttributeMetadata implements HandlerInterface
2121
private $typePool;
2222

2323
/**
24-
* Initialize dependencies.
25-
*
2624
* @param Pool $typePool
2725
*/
2826
public function __construct(Pool $typePool)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public function __construct(\Magento\GraphQl\Model\Type\HandlerFactory $typeHand
3434
}
3535

3636
/**
37-
* {@inheritdoc}
37+
* @param string $typeName
38+
* @return TypeInterface
3839
*/
3940
public function getType(string $typeName)
4041
{

0 commit comments

Comments
 (0)