268 lines
10 KiB
PHP
268 lines
10 KiB
PHP
<?php
|
|
|
|
use Cms\Classes\Theme;
|
|
use GermanAirlinesVa\Graphql\Models\Settings;
|
|
|
|
return [
|
|
'connection' => [
|
|
'driver' => 'mysql',
|
|
'url' => env('DATABASE_URL'),
|
|
'host' => env('DB_HOST', '127.0.0.1'),
|
|
'port' => env('DB_PORT', '3306'),
|
|
'database' => 'germanairlinesva_graphql',
|
|
'username' => env('DB_USERNAME', 'root'),
|
|
'password' => env('DB_PASSWORD', ''),
|
|
'unix_socket' => env('DB_SOCKET', ''),
|
|
'charset' => 'utf8mb4',
|
|
'collation' => 'utf8mb4_unicode_ci',
|
|
'prefix' => '',
|
|
'prefix_indexes' => true,
|
|
'strict' => true,
|
|
'engine' => 'InnoDB',
|
|
'options' => extension_loaded('pdo_mysql')
|
|
? array_filter([
|
|
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
|
])
|
|
: [],
|
|
],
|
|
'packages' => [
|
|
'nuwave/lighthouse' => [
|
|
'config_namespace' => 'lighthouse',
|
|
'providers' => ['Nuwave\Lighthouse\LighthouseServiceProvider'],
|
|
'aliases' => [],
|
|
'config' => [
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Route Configuration
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Controls the HTTP route that your GraphQL server responds to.
|
|
| You may set `route` => false, to disable the default route
|
|
| registration and take full control.
|
|
|
|
|
*/
|
|
|
|
'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',
|
|
|
|
/*
|
|
*
|
|
* 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
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This is a path that points to where your GraphQL schema is located
|
|
| relative to the app path. You should define your entire GraphQL
|
|
| schema in this file (additional files may be imported).
|
|
|
|
|
*/
|
|
|
|
'schema' => [
|
|
'register' => '',
|
|
],
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Schema Cache
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| A large part of schema generation consists of parsing and AST manipulation.
|
|
| This operation is very expensive, so it is highly recommended to enable
|
|
| caching of the final schema to optimize performance of large schemas.
|
|
|
|
|
*/
|
|
|
|
'cache' => [
|
|
'enable' => Settings::get('enable_cache', false),
|
|
'key' => env('GRAPHQL_CACHE_KEY', 'graphql-schema'),
|
|
'ttl' => env('GRAPHQL_CACHE_TTL', null),
|
|
],
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Namespaces
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| These are the default namespaces where Lighthouse looks for classes
|
|
| that extend functionality of the schema. You may pass either a string
|
|
| or an array, they are tried in order and the first match is used.
|
|
|
|
|
*/
|
|
|
|
'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
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Control how Lighthouse handles security related query validation.
|
|
| This configures the options from http://webonyx.github.io/graphql-php/security/
|
|
|
|
|
*/
|
|
|
|
'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
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Limits the maximum "count" that users may pass as an argument
|
|
| to fields that are paginated with the @paginate directive.
|
|
| A setting of "null" means the count is unrestricted.
|
|
|
|
|
*/
|
|
|
|
'paginate_max_count' => null,
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Pagination Amount Argument
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Set the name to use for the generated argument on paginated fields
|
|
| that controls how many results are returned.
|
|
| This setting will be removed in v5.
|
|
|
|
|
*/
|
|
|
|
'pagination_amount_argument' => 'first',
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Debug
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Control the debug level as described in http://webonyx.github.io/graphql-php/error-handling/
|
|
| Debugging is only applied if the global Laravel debug config is set to true.
|
|
|
|
|
*/
|
|
|
|
//'debug' => \GraphQL\Error\Debug::INCLUDE_DEBUG_MESSAGE | \GraphQL\Error\Debug::INCLUDE_TRACE,
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Error Handlers
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Register error handlers that receive the Errors that occur during execution
|
|
| and handle them. You may use this to log, filter or format the errors.
|
|
| The classes must implement \Nuwave\Lighthouse\Execution\ErrorHandler
|
|
|
|
|
*/
|
|
|
|
'error_handlers' => [\Nuwave\Lighthouse\Execution\ExtensionErrorHandler::class],
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Global ID
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| The name that is used for the global id field on the Node interface.
|
|
| When creating a Relay compliant server, this must be named "id".
|
|
|
|
|
*/
|
|
|
|
'global_id_field' => 'id',
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Batched Queries
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| GraphQL query batching means sending multiple queries to the server in one request,
|
|
| You may set this flag to either process or deny batched queries.
|
|
|
|
|
*/
|
|
|
|
'batched_queries' => Settings::get('batched_queries', true),
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Transactional Mutations
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Sets default setting for transactional mutations.
|
|
| You may set this flag to have @create|@update mutations transactional or not.
|
|
|
|
|
*/
|
|
|
|
'transactional_mutations' => true,
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| GraphQL Subscriptions
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here you can define GraphQL subscription "broadcasters" and "storage" drivers
|
|
| as well their required configuration options.
|
|
|
|
|
*/
|
|
|
|
'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 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',
|
|
],
|
|
],
|
|
],
|
|
],
|
|
],
|
|
],
|
|
];
|