Skip to content

Commit f30bb79

Browse files
committed
Upgrade graphql-php to v0.13.6
Follows upgrade path outlined in https://github.com/webonyx/graphql-php/blob/master/UPGRADE.md
1 parent a9a32dc commit f30bb79

File tree

4 files changed

+50
-23
lines changed

4 files changed

+50
-23
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"symfony/process": "~4.1.0|~4.2.0|~4.3.0",
5353
"tedivm/jshrink": "~1.3.0",
5454
"tubalmartin/cssmin": "4.1.1",
55-
"webonyx/graphql-php": "^0.12.6",
55+
"webonyx/graphql-php": "^0.13.6",
5656
"zendframework/zend-captcha": "^2.7.1",
5757
"zendframework/zend-code": "~3.3.0",
5858
"zendframework/zend-config": "^2.6.0",

composer.lock

Lines changed: 26 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/internal/Magento/Framework/GraphQl/Schema/Type/ResolveInfoFactory.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,27 @@
77

88
namespace Magento\Framework\GraphQl\Schema\Type;
99

10+
use Magento\Framework\ObjectManagerInterface;
11+
1012
/**
1113
* Factory for wrapper of GraphQl ResolveInfo
1214
*/
1315
class ResolveInfoFactory
1416
{
17+
/**
18+
* @var ObjectManagerInterface
19+
*/
20+
private $objectManager;
21+
22+
/**
23+
* @param ObjectManagerInterface $objectManager
24+
*/
25+
public function __construct(
26+
ObjectManagerInterface $objectManager
27+
) {
28+
$this->objectManager = $objectManager;
29+
}
30+
1531
/**
1632
* Create a wrapper resolver info from the instance of the library object
1733
*
@@ -25,6 +41,6 @@ public function create(\GraphQL\Type\Definition\ResolveInfo $info) : ResolveInfo
2541
$values[$key] = $value;
2642
}
2743

28-
return new ResolveInfo($values);
44+
return $this->objectManager->create(ResolveInfo::class, $values);
2945
}
3046
}

lib/internal/Magento/Framework/GraphQl/Schema/Type/ScalarTypes.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,27 @@
1313
class ScalarTypes
1414
{
1515
/**
16+
* Check if type is scalar
17+
*
1618
* @param string $typeName
1719
* @return bool
1820
*/
1921
public function isScalarType(string $typeName) : bool
2022
{
21-
$internalTypes = \GraphQL\Type\Definition\Type::getInternalTypes();
23+
$internalTypes = \GraphQL\Type\Definition\Type::getStandardTypes();
2224
return isset($internalTypes[$typeName]) ? true : false;
2325
}
2426

2527
/**
28+
* Get instance of scalar type
29+
*
2630
* @param string $typeName
2731
* @return \GraphQL\Type\Definition\ScalarType|\GraphQL\Type\Definition\Type
2832
* @throws \LogicException
2933
*/
3034
public function getScalarTypeInstance(string $typeName) : \GraphQL\Type\Definition\Type
3135
{
32-
$internalTypes = \GraphQL\Type\Definition\Type::getInternalTypes();
36+
$internalTypes = \GraphQL\Type\Definition\Type::getStandardTypes();
3337
if ($this->isScalarType($typeName)) {
3438
return $internalTypes[$typeName];
3539
} else {

0 commit comments

Comments
 (0)