From 67a2231c173d7f69764c4f3886b8c8acb7270be4 Mon Sep 17 00:00:00 2001 From: "denis.vinokurov" Date: Wed, 27 Oct 2021 10:41:01 +0700 Subject: [PATCH 1/2] Add support thecodingmachine/graphqlite 5 --- .travis.yml | 1 + composer.json | 9 ++++++--- src/Controllers/GraphQLiteController.php | 4 ++-- src/Providers/GraphQLiteServiceProvider.php | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 538ccd9..39eae8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ php: - 7.2 - 7.3 - 7.4 + - 8.0 env: matrix: diff --git a/composer.json b/composer.json index 1f9b563..2505a22 100644 --- a/composer.json +++ b/composer.json @@ -16,9 +16,12 @@ "homepage": "http://mouf-php.com" } ], + "scripts": { + "test": "phpunit" + }, "require": { - "php": ">=7.2", - "thecodingmachine/graphqlite": "^4", + "php": ">=7.2|8.0", + "thecodingmachine/graphqlite": "^5", "illuminate/console": "^5.7|^6.0|^7|^8", "illuminate/container": "^5.7|^6.0|^7|^8", "illuminate/support": "^5.7|^6.0|^7|^8", @@ -44,7 +47,7 @@ }, "extra": { "branch-alias": { - "dev-master": "4.1.x-dev" + "dev-master": "5.0.x-dev" }, "laravel": { "providers": [ diff --git a/src/Controllers/GraphQLiteController.php b/src/Controllers/GraphQLiteController.php index aab1e5d..02b5705 100644 --- a/src/Controllers/GraphQLiteController.php +++ b/src/Controllers/GraphQLiteController.php @@ -5,7 +5,7 @@ use Illuminate\Http\Request; -use GraphQL\Error\Debug; +use GraphQL\Error\DebugFlag; use GraphQL\Executor\ExecutionResult; use GraphQL\Executor\Promise\Promise; use GraphQL\Server\StandardServer; @@ -33,7 +33,7 @@ class GraphQLiteController /** @var bool|int */ private $debug; - public function __construct(StandardServer $standardServer, HttpMessageFactoryInterface $httpMessageFactory = null, ?int $debug = Debug::RETHROW_UNSAFE_EXCEPTIONS) + public function __construct(StandardServer $standardServer, HttpMessageFactoryInterface $httpMessageFactory = null, ?int $debug = DebugFlag::RETHROW_UNSAFE_EXCEPTIONS) { $this->standardServer = $standardServer; $this->httpMessageFactory = $httpMessageFactory ?: new DiactorosFactory(); diff --git a/src/Providers/GraphQLiteServiceProvider.php b/src/Providers/GraphQLiteServiceProvider.php index ed15028..70db094 100644 --- a/src/Providers/GraphQLiteServiceProvider.php +++ b/src/Providers/GraphQLiteServiceProvider.php @@ -28,7 +28,7 @@ use TheCodingMachine\GraphQLite\Security\AuthenticationServiceInterface; use function config; use function extension_loaded; -use GraphQL\Error\Debug; +use GraphQL\Error\DebugFlag; use GraphQL\Server\ServerConfig; use GraphQL\Server\StandardServer; use Illuminate\Contracts\Foundation\Application; @@ -87,7 +87,7 @@ public function register() $this->app->bind(HttpMessageFactoryInterface::class, PsrHttpFactory::class); $this->app->singleton(GraphQLiteController::class, function (Application $app) { - $debug = config('graphqlite.debug', Debug::RETHROW_UNSAFE_EXCEPTIONS); + $debug = config('graphqlite.debug', DebugFlag::RETHROW_UNSAFE_EXCEPTIONS); return new GraphQLiteController($app[StandardServer::class], $app[HttpMessageFactoryInterface::class], $debug); }); From 982f76341be4459eec42a565e0904e5c43ed0ea0 Mon Sep 17 00:00:00 2001 From: "denis.vinokurov" Date: Wed, 10 Nov 2021 10:34:16 +0700 Subject: [PATCH 2/2] fixes after code review --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2505a22..94e3c01 100644 --- a/composer.json +++ b/composer.json @@ -20,8 +20,8 @@ "test": "phpunit" }, "require": { - "php": ">=7.2|8.0", - "thecodingmachine/graphqlite": "^5", + "php": ">=7.2", + "thecodingmachine/graphqlite": "^5.0", "illuminate/console": "^5.7|^6.0|^7|^8", "illuminate/container": "^5.7|^6.0|^7|^8", "illuminate/support": "^5.7|^6.0|^7|^8",