Completed
Push — master ( 17976d...325209 )
by Portey
07:00
created

QueryType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 1
Bugs 1 Features 1
Metric Value
wmc 3
c 1
b 1
f 1
lcom 0
cbo 5
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 4 1
A build() 0 14 1
A getName() 0 4 1
1
<?php
2
/**
3
 * Date: 16.12.15
4
 *
5
 * @author Portey Vasil <[email protected]>
6
 */
7
8
namespace Youshido\Tests\Type\Union\Schema;
9
10
11
use Youshido\GraphQL\Type\Config\TypeConfigInterface;
12
use Youshido\GraphQL\Type\ListType\ListType;
13
use Youshido\GraphQL\Type\Object\AbstractObjectType;
14
15
class QueryType extends AbstractObjectType
16
{
17
18
    public function resolve($value = null, $args = [])
19
    {
20
        // TODO: Implement resolve() method.
21
    }
22
23
    protected function build(TypeConfigInterface $config)
24
    {
25
        $config
26
            ->addField('unionList', new ListType(new TestUnionType()), [
27
                'resolve' => function() {
28
                    return UnionTestData::getList();
29
                }
30
            ])
31
            ->addField('oneUnion', new TestUnionType(), [
32
                'resolve' => function () {
33
                    return UnionTestData::getOne();
34
                }
35
            ]);
36
    }
37
38
    /**
39
     * @return String type name
40
     */
41
    public function getName()
42
    {
43
        return 'RootQueryType';
44
    }
45
}