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

SchemaField::setSchema()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
ccs 3
cts 3
cp 1
cc 1
eloc 2
nc 1
nop 1
crap 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