Completed
Push — master ( ed70fa...5a4e4f )
by Portey
03:04
created

MutationType::resolve()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 9
ccs 0
cts 4
cp 0
rs 9.6667
cc 2
eloc 4
nc 2
nop 2
crap 6
1
<?php
2
/**
3
 * Date: 03.12.15
4
 *
5
 * @author Portey Vasil <[email protected]>
6
 */
7
8
namespace Youshido\GraphQL\Definition;
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
    public function resolve($value = null, $args = [])
19
    {
20
        /** @var Schema|Field  $value */
21
        if($value instanceof Schema){
22
            return $value->getMutationType();
23
        }
24
25
        return $value->getConfig()->getType();
26
    }
27
28
}