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

DefaultSchema::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 4
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
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