Skip to content

Commit

Permalink
Allow webonyx/graphql-php 14 (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcg-web committed Jul 7, 2020
1 parent ff2292c commit 241760a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"require": {
"php": ">=7.1",
"webonyx/graphql-php": "^0.13.0"
"webonyx/graphql-php": ">=0.13"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.14",
Expand Down
6 changes: 5 additions & 1 deletion tests/AbstractStarWarsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Overblog\GraphQLGenerator\Tests;

use GraphQL\Error\Debug;
use GraphQL\Error\DebugFlag;
use GraphQL\GraphQL;
use GraphQL\Type\Schema;
use Overblog\GraphQLGenerator\Tests\Generator\AbstractTypeGeneratorTest;
Expand All @@ -38,8 +39,11 @@ public function setUp(): void

protected function assertValidQuery(string $query, array $expected, array $variables = null): void
{
// TODO(mcg-web): remove this when migrating to webonyx/graphql-php >= 14.0
$debug = \class_exists('GraphQL\Error\DebugFlag') ? DebugFlag::class : Debug::class;

$actual = GraphQL::executeQuery($this->schema, $query, null, null, $variables)
->toArray(Debug::INCLUDE_DEBUG_MESSAGE | Debug::INCLUDE_TRACE);
->toArray($debug::INCLUDE_DEBUG_MESSAGE | $debug::INCLUDE_TRACE);
$expected = ['data' => $expected];
$this->assertEquals($expected, $actual, \json_encode($actual));
}
Expand Down

0 comments on commit 241760a

Please sign in to comment.