|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Drupal\graphql\Routing; |
|
4
|
|
|
|
|
5
|
|
|
use Drupal\Core\Routing\RouteSubscriberBase; |
|
|
|
|
|
|
6
|
|
|
use Drupal\graphql\Plugin\SchemaPluginManager; |
|
7
|
|
|
use Symfony\Component\Routing\Route; |
|
|
|
|
|
|
8
|
|
|
use Symfony\Component\Routing\RouteCollection; |
|
|
|
|
|
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Registers routes for all configurable schemas. |
|
12
|
|
|
*/ |
|
13
|
|
|
class ConfigurationRoutes extends RouteSubscriberBase { |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* The graphql schema plugin manager. |
|
17
|
|
|
* |
|
18
|
|
|
* @var \Drupal\graphql\Plugin\SchemaPluginManager |
|
19
|
|
|
*/ |
|
20
|
|
|
protected $schemaManager; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* ConfigurationRoutes constructor. |
|
24
|
|
|
* |
|
25
|
|
|
* @param \Drupal\graphql\Plugin\SchemaPluginManager $schemaManager |
|
26
|
|
|
* The graphql schema plugin manager. |
|
27
|
|
|
*/ |
|
28
|
|
|
public function __construct(SchemaPluginManager $schemaManager) { |
|
29
|
|
|
$this->schemaManager = $schemaManager; |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* Alters existing routes for a specific collection. |
|
34
|
|
|
* |
|
35
|
|
|
* @param \Symfony\Component\Routing\RouteCollection $collection |
|
36
|
|
|
* The route collection for adding routes. |
|
37
|
|
|
*/ |
|
38
|
|
|
protected function alterRoutes(RouteCollection $collection) { |
|
39
|
|
|
$routes = new RouteCollection(); |
|
40
|
|
|
|
|
41
|
|
|
foreach ($this->schemaManager->getDefinitions() as $key => $definition) { |
|
42
|
|
|
if (empty($definition['uses_plugins'])) { |
|
43
|
|
|
continue; |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
$routes->add("graphql.configuration.$key", new Route("{$definition['path']}/configure", [ |
|
47
|
|
|
'schema' => $key, |
|
48
|
|
|
'_controller' => '\Drupal\graphql\Controller\ConfigurationController::configurationOverview', |
|
49
|
|
|
'_title' => 'Configuration', |
|
50
|
|
|
], [ |
|
51
|
|
|
'_admin_route' => 'TRUE', |
|
52
|
|
|
])); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
$collection->addCollection($routes); |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
} |
|
59
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths