GraphiQL in Backend

This commit is contained in:
Gogs
2021-06-02 15:46:20 +02:00
parent e7d7d18f77
commit a65593b4f9
24 changed files with 61895 additions and 617 deletions
+98 -104
View File
@@ -4,17 +4,13 @@ use Cms\Classes\Theme;
use GermanAirlinesVa\Graphql\Models\Settings;
return [
'packages' => [
'nuwave/lighthouse' => [
'config_namespace' => 'lighthouse',
'providers' => [
'Nuwave\Lighthouse\LighthouseServiceProvider'
],
'aliases' => [
],
'config' => [
/*
'packages' => [
'nuwave/lighthouse' => [
'config_namespace' => 'lighthouse',
'providers' => ['Nuwave\Lighthouse\LighthouseServiceProvider'],
'aliases' => [],
'config' => [
/*
|--------------------------------------------------------------------------
| Route Configuration
|--------------------------------------------------------------------------
@@ -25,27 +21,27 @@ return [
|
*/
'route' => [
/*
* The URI the endpoint responds to, e.g. mydomain.com/graphql.
*/
'uri' => 'graphql',
'route' => [
/*
* The URI the endpoint responds to, e.g. mydomain.com/graphql.
*/
'uri' => 'graphql',
/*
* Lighthouse creates a named route for convenient URL generation and redirects.
*/
'name' => 'graphql',
/*
* Lighthouse creates a named route for convenient URL generation and redirects.
*/
'name' => 'graphql',
/*
*
* Beware that middleware defined here runs before the GraphQL execution phase,
* so you have to take extra care to return spec-compliant error responses.
* To apply middleware on a field level, use the @middleware directive.
*/
'middleware' => [\Nuwave\Lighthouse\Support\Http\Middleware\AcceptJson::class]
],
/*
*
* Beware that middleware defined here runs before the GraphQL execution phase,
* so you have to take extra care to return spec-compliant error responses.
* To apply middleware on a field level, use the @middleware directive.
*/
'middleware' => [\Nuwave\Lighthouse\Support\Http\Middleware\AcceptJson::class],
],
/*
/*
|--------------------------------------------------------------------------
| Schema Declaration
|--------------------------------------------------------------------------
@@ -56,11 +52,11 @@ return [
|
*/
'schema' => [
'register' => '',
],
'schema' => [
'register' => '',
],
/*
/*
|--------------------------------------------------------------------------
| Schema Cache
|--------------------------------------------------------------------------
@@ -71,13 +67,13 @@ return [
|
*/
'cache' => [
'enable' => Settings::get('enable_cache', false),
'key' => env('GRAPHQL_CACHE_KEY', 'graphql-schema'),
'ttl' => env('GRAPHQL_CACHE_TTL', null),
],
'cache' => [
'enable' => Settings::get('enable_cache', false),
'key' => env('GRAPHQL_CACHE_KEY', 'graphql-schema'),
'ttl' => env('GRAPHQL_CACHE_TTL', null),
],
/*
/*
|--------------------------------------------------------------------------
| Namespaces
|--------------------------------------------------------------------------
@@ -88,18 +84,18 @@ return [
|
*/
'namespaces' => [
'models' => 'Graphql\\Models',
'queries' => 'Graphql\\Queries',
'mutations' => 'Graphql\\Mutations',
'subscriptions' => 'Graphql\\Subscriptions',
'interfaces' => 'Graphql\\Interfaces',
'unions' => 'Graphql\\Unions',
'scalars' => 'Graphql\\Scalars',
'directives' => ['GermanAirlinesVa\\Graphql\\GraphQL\\Directives', 'Graphql\\Directives'],
],
'namespaces' => [
'models' => 'Graphql\\Models',
'queries' => 'Graphql\\Queries',
'mutations' => 'Graphql\\Mutations',
'subscriptions' => 'Graphql\\Subscriptions',
'interfaces' => 'Graphql\\Interfaces',
'unions' => 'Graphql\\Unions',
'scalars' => 'Graphql\\Scalars',
'directives' => ['GermanAirlinesVa\\Graphql\\GraphQL\\Directives', 'Graphql\\Directives'],
],
/*
/*
|--------------------------------------------------------------------------
| Security
|--------------------------------------------------------------------------
@@ -109,13 +105,13 @@ return [
|
*/
'security' => [
'max_query_complexity' => \GraphQL\Validator\Rules\QueryComplexity::DISABLED,
'max_query_depth' => \GraphQL\Validator\Rules\QueryDepth::DISABLED,
'disable_introspection' => \GraphQL\Validator\Rules\DisableIntrospection::DISABLED,
],
'security' => [
'max_query_complexity' => \GraphQL\Validator\Rules\QueryComplexity::DISABLED,
'max_query_depth' => \GraphQL\Validator\Rules\QueryDepth::DISABLED,
'disable_introspection' => \GraphQL\Validator\Rules\DisableIntrospection::DISABLED,
],
/*
/*
|--------------------------------------------------------------------------
| Pagination
|--------------------------------------------------------------------------
@@ -126,9 +122,9 @@ return [
|
*/
'paginate_max_count' => null,
'paginate_max_count' => null,
/*
/*
|--------------------------------------------------------------------------
| Pagination Amount Argument
|--------------------------------------------------------------------------
@@ -139,9 +135,9 @@ return [
|
*/
'pagination_amount_argument' => 'first',
'pagination_amount_argument' => 'first',
/*
/*
|--------------------------------------------------------------------------
| Debug
|--------------------------------------------------------------------------
@@ -151,9 +147,9 @@ return [
|
*/
'debug' => \GraphQL\Error\Debug::INCLUDE_DEBUG_MESSAGE | \GraphQL\Error\Debug::INCLUDE_TRACE,
'debug' => \GraphQL\Error\Debug::INCLUDE_DEBUG_MESSAGE | \GraphQL\Error\Debug::INCLUDE_TRACE,
/*
/*
|--------------------------------------------------------------------------
| Error Handlers
|--------------------------------------------------------------------------
@@ -164,11 +160,9 @@ return [
|
*/
'error_handlers' => [
\Nuwave\Lighthouse\Execution\ExtensionErrorHandler::class,
],
'error_handlers' => [\Nuwave\Lighthouse\Execution\ExtensionErrorHandler::class],
/*
/*
|--------------------------------------------------------------------------
| Global ID
|--------------------------------------------------------------------------
@@ -178,9 +172,9 @@ return [
|
*/
'global_id_field' => 'id',
'global_id_field' => 'id',
/*
/*
|--------------------------------------------------------------------------
| Batched Queries
|--------------------------------------------------------------------------
@@ -190,9 +184,9 @@ return [
|
*/
'batched_queries' => Settings::get('batched_queries', true),
'batched_queries' => Settings::get('batched_queries', true),
/*
/*
|--------------------------------------------------------------------------
| Transactional Mutations
|--------------------------------------------------------------------------
@@ -202,9 +196,9 @@ return [
|
*/
'transactional_mutations' => true,
'transactional_mutations' => true,
/*
/*
|--------------------------------------------------------------------------
| GraphQL Subscriptions
|--------------------------------------------------------------------------
@@ -214,39 +208,39 @@ return [
|
*/
'subscriptions' => [
/*
* Determines if broadcasts should be queued by default.
*/
'queue_broadcasts' => env('LIGHTHOUSE_QUEUE_BROADCASTS', true),
'subscriptions' => [
/*
* Determines if broadcasts should be queued by default.
*/
'queue_broadcasts' => env('LIGHTHOUSE_QUEUE_BROADCASTS', true),
/*
* Default subscription storage.
*
* Any Laravel supported cache driver options are available here.
*/
'storage' => env('LIGHTHOUSE_SUBSCRIPTION_STORAGE', 'redis'),
/*
* Default subscription storage.
*
* Any Laravel supported cache driver options are available here.
*/
'storage' => env('LIGHTHOUSE_SUBSCRIPTION_STORAGE', 'redis'),
/*
* Default subscription broadcaster.
*/
'broadcaster' => env('LIGHTHOUSE_BROADCASTER', 'pusher'),
/*
* Default subscription broadcaster.
*/
'broadcaster' => env('LIGHTHOUSE_BROADCASTER', 'pusher'),
/*
* Subscription broadcasting drivers with config options.
*/
'broadcasters' => [
'log' => [
'driver' => 'log',
],
'pusher' => [
'driver' => 'pusher',
'routes' => \Nuwave\Lighthouse\Subscriptions\SubscriptionRouter::class.'@pusher',
'connection' => 'pusher',
],
],
],
]
]
]
/*
* Subscription broadcasting drivers with config options.
*/
'broadcasters' => [
'log' => [
'driver' => 'log',
],
'pusher' => [
'driver' => 'pusher',
'routes' => \Nuwave\Lighthouse\Subscriptions\SubscriptionRouter::class . '@pusher',
'connection' => 'pusher',
],
],
],
],
],
],
];