Skip to content

Commit

Permalink
Merge pull request silverstripe#198 from ntd/pr1
Browse files Browse the repository at this point in the history
PHP 7.3.0 support (silverstripe#197)
  • Loading branch information
robbieaverill authored Jan 31, 2019
2 parents 2e4b121 + 9c6e853 commit c994549
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,7 @@ Example middleware to log all mutations (but not queries):

```php
<?php
use GraphQL\Schema;
use GraphQL\Type\Schema;
use SilverStripe\GraphQL\Middleware\QueryMiddleware;
class MyMutationLoggingMiddleware implements QueryMiddleware
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {
"silverstripe/framework": "^4.2",
"silverstripe/vendor-plugin": "^1.0",
"webonyx/graphql-php": "~0.8.0"
"webonyx/graphql-php": "~0.12.6"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
Expand Down
4 changes: 2 additions & 2 deletions src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use InvalidArgumentException;
use GraphQL\Executor\ExecutionResult;
use GraphQL\Language\SourceLocation;
use GraphQL\Schema;
use GraphQL\Type\Schema;
use GraphQL\GraphQL;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Extensible;
Expand Down Expand Up @@ -352,7 +352,7 @@ public function queryAndReturnResult($query, $params = [])
$context = $this->getContext();

$last = function ($schema, $query, $context, $params) {
return GraphQL::executeAndReturnResult($schema, $query, null, $context, $params);
return GraphQL::executeQuery($schema, $query, null, $context, $params);
};

return $this->callMiddleware($schema, $query, $context, $params, $last);
Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/CSRFMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SilverStripe\GraphQL\Middleware;

use GraphQL\Schema;
use GraphQL\Type\Schema;
use SilverStripe\GraphQL\Middleware\QueryMiddleware;
use SilverStripe\Security\SecurityToken;
use Exception;
Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/HTTPMethodMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SilverStripe\GraphQL\Middleware;

use GraphQL\Schema;
use GraphQL\Type\Schema;
use SilverStripe\GraphQL\Middleware\QueryMiddleware;
use Exception;

Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/QueryMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace SilverStripe\GraphQL\Middleware;

use GraphQL\Executor\ExecutionResult;
use GraphQL\Schema;
use GraphQL\Type\Schema;

/**
* Represents middleware for evaluating a graphql query
Expand Down
5 changes: 2 additions & 3 deletions tests/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use GraphQL\Error\Error;
use GraphQL\Language\SourceLocation;
use GraphQL\Schema;
use GraphQL\Type\Definition\Type;
use GraphQL\Type\Schema;
use InvalidArgumentException;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Injector\Injector;
Expand Down Expand Up @@ -188,8 +188,7 @@ public function testQueryWithError()
$responseData->data = null;
$responseData->errors = [
Error::createLocatedError(
'Something went wrong',
[new SourceLocation(1, 10)]
'Something went wrong'
),
];
$mock->method('queryAndReturnResult')
Expand Down
2 changes: 1 addition & 1 deletion tests/Middleware/DummyResponseMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SilverStripe\GraphQL\Tests\Middleware;

use GraphQL\Schema;
use GraphQL\Type\Schema;
use SilverStripe\GraphQL\Middleware\QueryMiddleware;

class DummyResponseMiddleware implements QueryMiddleware
Expand Down
2 changes: 1 addition & 1 deletion tests/Middleware/MiddlewareProcessTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace SilverStripe\GraphQL\Tests\Middleware;

use GraphQL\Schema;
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\Type;
use GraphQL\Type\Schema;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\GraphQL\Middleware\QueryMiddleware;

Expand Down

0 comments on commit c994549

Please sign in to comment.