Completed
Pull Request — master (#35)
by Sebastian
09:15
created

SchemaField   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 3
c 3
b 0
f 0
lcom 0
cbo 4
dl 0
loc 22
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 4 1
A getName() 0 4 1
A resolve() 0 4 1
1
<?php
2
/**
3
 * Date: 16.05.16
4
 *
5
 * @author Portey Vasil <[email protected]>
6
 */
7
8
namespace Youshido\GraphQL\Introspection\Field;
9
10
11
use Youshido\GraphQL\Execution\ResolveInfo;
12
use Youshido\GraphQL\Field\AbstractField;
13
use Youshido\GraphQL\Introspection\SchemaType;
14
use Youshido\GraphQL\Type\Object\AbstractObjectType;
15
16
class SchemaField extends AbstractField
17
{
18
    /**
19
     * @return AbstractObjectType
20
     */
21 24
    public function getType()
22
    {
23 24
        return new SchemaType();
24
    }
25
26 24
    public function getName()
27
    {
28 24
        return '__schema';
29
    }
30
31 6
    public function resolve($value, array $args, ResolveInfo $info)
32
    {
33 6
        return $info->getExecutionContext()->getSchema();
34
    }
35
36
37
}
38