Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
{
"name" : "thecodingmachine/graphqlite-laravel",
"description" : "A Laravel service provider package to help you get started with GraphQLite in Laravel.",
"keywords" : [
"name": "thecodingmachine/graphqlite-laravel",
"description": "A Laravel service provider package to help you get started with GraphQLite in Laravel.",
"keywords": [
"GraphQL",
"GraphQLite",
"Laravel"
],
"homepage" : "https://github.com/thecodingmachine/graphqlite",
"type" : "library",
"license" : "MIT",
"authors" : [{
"name" : "David Négrier",
"email" : "d.negrier@thecodingmachine.com",
"homepage" : "http://mouf-php.com"
"homepage": "https://github.com/thecodingmachine/graphqlite",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "David N\u00e9grier",
"email": "d.negrier@thecodingmachine.com",
"homepage": "http://mouf-php.com"
}
],
"require" : {
"php" : ">=7.2",
"thecodingmachine/graphqlite" : "^4",
"require": {
"php": ">=7.2",
"thecodingmachine/graphqlite": "^4",
"illuminate/console": "^5.7|^6.0",
"illuminate/container": "^5.7|^6.0",
"illuminate/support": "^5.7|^6.0",
"illuminate/cache": "^5.7|^6.0",
"symfony/psr-http-message-bridge": "^1",
"zendframework/zend-diactoros": "^1.8.6",
"symfony/psr-http-message-bridge": "^1.3.0 || ^2",
"laminas/laminas-diactoros": "^2.2.2",
"symfony/cache": "^4.3 || ^5"
},
"require-dev": {
"orchestra/testbench": "^3.7.7 || ^4",
"phpunit/phpunit": "^7.5.4 || ^8.3",
"ext-sqlite3": "*"
},
"autoload" : {
"psr-4" : {
"TheCodingMachine\\GraphQLite\\Laravel\\" : "src/"
"autoload": {
"psr-4": {
"TheCodingMachine\\GraphQLite\\Laravel\\": "src/"
}
},
"autoload-dev" : {
"psr-4" : {
"App\\" : "tests/Fixtures/App"
"autoload-dev": {
"psr-4": {
"App\\": "tests/Fixtures/App"
}
},
"extra": {
Expand Down
24 changes: 23 additions & 1 deletion src/Providers/GraphQLiteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
use Illuminate\Contracts\Auth\Access\Gate;
use Illuminate\Contracts\Auth\Factory as AuthFactory;
use Illuminate\Contracts\Events\Dispatcher;
use Laminas\Diactoros\ResponseFactory;
use Laminas\Diactoros\ServerRequestFactory;
use Laminas\Diactoros\StreamFactory;
use Laminas\Diactoros\UploadedFileFactory;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ServerRequestFactoryInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\UploadedFileFactoryInterface;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Symfony\Component\Cache\Adapter\ApcuAdapter;
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
use Symfony\Component\Cache\Psr16Cache;
Expand Down Expand Up @@ -62,7 +71,20 @@ public function register()
{
$this->app->bind(WebonyxSchema::class, Schema::class);

$this->app->bind(HttpMessageFactoryInterface::class, DiactorosFactory::class);
if (!$this->app->has(ServerRequestFactoryInterface::class)) {
$this->app->bind(ServerRequestFactoryInterface::class, ServerRequestFactory::class);
}
if (!$this->app->has(StreamFactoryInterface::class)) {
$this->app->bind(StreamFactoryInterface::class, StreamFactory::class);
}
if (!$this->app->has(UploadedFileFactoryInterface::class)) {
$this->app->bind(UploadedFileFactoryInterface::class, UploadedFileFactory::class);
}
if (!$this->app->has(ResponseFactoryInterface::class)) {
$this->app->bind(ResponseFactoryInterface::class, ResponseFactory::class);
}

$this->app->bind(HttpMessageFactoryInterface::class, PsrHttpFactory::class);

$this->app->singleton(GraphQLiteController::class, function (Application $app) {
$debug = config('graphqlite.debug', Debug::RETHROW_UNSAFE_EXCEPTIONS);
Expand Down