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

GraphQLUndefined::getDefinition()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Drupal\graphql\Plugin\GraphQL\Scalars;
4
5
use Drupal\graphql\GraphQL\Type\UndefinedType;
6
use Drupal\graphql\Plugin\GraphQL\PluggableSchemaBuilderInterface;
7
8
/**
9
 * @GraphQLScalar(
10
 *   id = "undefined",
11
 *   name = "Undefined",
12
 *   type = "undefined"
13
 * )
14
 */
15
class GraphQLUndefined extends ScalarPluginBase {
0 ignored issues
show
Bug introduced by
There is one abstract method getPluginDefinition in this class; you could implement it, or declare this class as abstract.
Loading history...
16
17
  /**
18
   * {@inheritdoc}
19
   */
20
  public function getDefinition(PluggableSchemaBuilderInterface $schemaBuilder) {
21
    if (!isset($this->definition)) {
22
      $this->definition = new UndefinedType();
23
    }
24
25
    return $this->definition;
26
  }
27
}
28