Completed
Pull Request — 8.x-3.x (#401)
by Sebastian
02:19
created

DefaultSchema   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 14 1
1
<?php
2
3
namespace Drupal\graphql_core\Plugin\GraphQL\Schemas;
4
5
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
6
use Drupal\graphql\Plugin\GraphQL\Schemas\PluggableSchemaPluginBase;
7
use Symfony\Component\DependencyInjection\ContainerInterface;
8
9
/**
10
 * Default generated schema.
11
 *
12
 * @GraphQLSchema(
13
 *   id = "default",
14
 *   name = "Default",
15
 *   path = "/graphql"
16
 * )
17
 */
18
class DefaultSchema extends PluggableSchemaPluginBase implements ContainerFactoryPluginInterface {
19
20
  /**
21
   * {@inheritdoc}
22
   */
23
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
24
    $managers = [
25
      $container->get('plugin.manager.graphql.type'),
26
      $container->get('plugin.manager.graphql.interface'),
27
      $container->get('plugin.manager.graphql.union_type'),
28
      $container->get('plugin.manager.graphql.input_type'),
29
      $container->get('plugin.manager.graphql.enum'),
30
      $container->get('plugin.manager.graphql.scalar'),
31
      $container->get('plugin.manager.graphql.field'),
32
      $container->get('plugin.manager.graphql.mutation'),
33
    ];
34
35
    return new static($configuration + ['managers' => $managers], $plugin_id, $plugin_definition);
36
  }
37
}
38