MutationType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 22
c 0
b 0
f 0
ccs 0
cts 13
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 15 2
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Type;
12
13
/**
14
 * Class MutationType
15
 */
16
class MutationType extends QueryType
17
{
18
    /**
19
     * MutationType constructor.
20
     *
21
     * @param array $config
22
     */
23
    public function __construct(array $config = [])
24
    {
25
        $defaults = [
26
            'name' => 'Mutation',
27
            'fields' => function () {
28
                $mutations = [];
29
                foreach ($this->endpoint->allMutations() as $query) {
30
                    $mutations[$query->getName()] = $this->getQueryConfig($query);
31
                }
32
33
                return $mutations;
34
            },
35
        ];
36
37
        parent::__construct(array_merge($defaults, $config));
38
    }
39
}
40