Skip to content

Commit 241760a

Browse files
committed
Allow webonyx/graphql-php 14 (#31)
1 parent ff2292c commit 241760a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"require": {
1818
"php": ">=7.1",
19-
"webonyx/graphql-php": "^0.13.0"
19+
"webonyx/graphql-php": ">=0.13"
2020
},
2121
"require-dev": {
2222
"friendsofphp/php-cs-fixer": "^2.14",

tests/AbstractStarWarsTest.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Overblog\GraphQLGenerator\Tests;
1313

1414
use GraphQL\Error\Debug;
15+
use GraphQL\Error\DebugFlag;
1516
use GraphQL\GraphQL;
1617
use GraphQL\Type\Schema;
1718
use Overblog\GraphQLGenerator\Tests\Generator\AbstractTypeGeneratorTest;
@@ -38,8 +39,11 @@ public function setUp(): void
3839

3940
protected function assertValidQuery(string $query, array $expected, array $variables = null): void
4041
{
42+
// TODO(mcg-web): remove this when migrating to webonyx/graphql-php >= 14.0
43+
$debug = \class_exists('GraphQL\Error\DebugFlag') ? DebugFlag::class : Debug::class;
44+
4145
$actual = GraphQL::executeQuery($this->schema, $query, null, null, $variables)
42-
->toArray(Debug::INCLUDE_DEBUG_MESSAGE | Debug::INCLUDE_TRACE);
46+
->toArray($debug::INCLUDE_DEBUG_MESSAGE | $debug::INCLUDE_TRACE);
4347
$expected = ['data' => $expected];
4448
$this->assertEquals($expected, $actual, \json_encode($actual));
4549
}

0 commit comments

Comments
 (0)