3
3
namespace Drupal \graphql \Controller ;
4
4
5
5
use Drupal \Core \DependencyInjection \ContainerInjectionInterface ;
6
+ use Drupal \Core \Extension \ModuleExtensionList ;
6
7
use Drupal \Core \Extension \ModuleHandlerInterface ;
7
8
use Drupal \Core \StringTranslation \StringTranslationTrait ;
8
9
use Drupal \graphql \Plugin \SchemaPluginManager ;
@@ -26,12 +27,20 @@ class SchemaOverviewController implements ContainerInjectionInterface {
26
27
*/
27
28
protected $ moduleHandler ;
28
29
30
+ /**
31
+ * The module extension list service.
32
+ *
33
+ * @var \Drupal\Core\Extension\ModuleExtensionList
34
+ */
35
+ protected $ moduleExtensionList ;
36
+
29
37
/**
30
38
* {@inheritdoc}
31
39
*/
32
40
public static function create (ContainerInterface $ container ) {
33
41
return new static (
34
42
$ container ->get ('module_handler ' ),
43
+ $ container ->get ('extension.list.module ' ),
35
44
$ container ->get ('plugin.manager.graphql.schema ' )
36
45
);
37
46
}
@@ -40,12 +49,15 @@ public static function create(ContainerInterface $container) {
40
49
* SchemaOverviewController constructor.
41
50
*
42
51
* @param \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler
43
- * The module handler srevice.
52
+ * The module handler service.
53
+ * @param \Drupal\Core\Extension\ModuleExtensionList $moduleExtensionList
54
+ * The module extension list service
44
55
* @param \Drupal\graphql\Plugin\SchemaPluginManager $schemaManager
45
56
* The schema plugin manager service.
46
57
*/
47
- public function __construct (ModuleHandlerInterface $ moduleHandler , SchemaPluginManager $ schemaManager ) {
58
+ public function __construct (ModuleHandlerInterface $ moduleHandler , ModuleExtensionList $ moduleExtensionList , SchemaPluginManager $ schemaManager ) {
48
59
$ this ->schemaManager = $ schemaManager ;
60
+ $ this ->moduleExtensionList = $ moduleExtensionList ;
49
61
$ this ->moduleHandler = $ moduleHandler ;
50
62
}
51
63
@@ -74,7 +86,7 @@ public function listSchemas() {
74
86
];
75
87
76
88
$ table ["schema: $ key " ]['provider ' ] = [
77
- '#plain_text ' => $ this ->moduleHandler ->getName ($ definition ['provider ' ]),
89
+ '#plain_text ' => $ this ->moduleExtensionList ->getName ($ definition ['provider ' ]),
78
90
];
79
91
80
92
$ table ["schema: $ key " ]['operations ' ] = $ this ->buildOperations ($ key , $ definition );
0 commit comments