Completed
Push — master ( 3a14e9...fe7442 )
by Portey
04:17
created

MutationType::resolve()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
ccs 3
cts 4
cp 0.75
rs 9.6667
cc 2
eloc 4
nc 2
nop 2
crap 2.0625
1
<?php
2
/**
3
 * Date: 03.12.15
4
 *
5
 * @author Portey Vasil <[email protected]>
6
 */
7
8
namespace Youshido\GraphQL\Introspection;
9
10
use Youshido\GraphQL\Schema;
11
use Youshido\GraphQL\Type\Config\TypeConfigInterface;
12
use Youshido\GraphQL\Type\Field\Field;
13
use Youshido\GraphQL\Type\Object\AbstractObjectType;
14
15
class MutationType extends QueryType
16
{
17
18 1
    public function resolve($value = null, $args = [])
19
    {
20
        /** @var Schema|Field $value */
21 1
        if ($value instanceof Schema) {
22 1
            return $value->getMutationType();
23
        }
24
25
        return $value->getConfig()->getType();
26
    }
27
28
}