-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathlighthouse.php
More file actions
54 lines (45 loc) · 1.85 KB
/
lighthouse.php
File metadata and controls
54 lines (45 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php declare(strict_types=1);
return [
/*
|--------------------------------------------------------------------------
| 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,
* make sure to return spec-compliant responses in case an error is thrown.
*/
'middleware' => [
// Ensures the request is not vulnerable to cross-site request forgery.
// Nuwave\Lighthouse\Http\Middleware\EnsureXHR::class,
// Always set the `Accept: application/json` header.
Nuwave\Lighthouse\Http\Middleware\AcceptJson::class,
Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
// Logs in a user if they are authenticated. In contrast to Laravel's 'auth'
// middleware, this delegates auth and permission checks to the field level.
Nuwave\Lighthouse\Http\Middleware\AttemptAuthentication::class,
// Logs every incoming GraphQL query.
// Nuwave\Lighthouse\Http\Middleware\LogGraphQLQueries::class,
],
/*
* The `prefix`, `domain` and `where` configuration options are optional.
*/
// 'prefix' => '',
// 'domain' => '',
// 'where' => [],
],
];