Test Failed
Push — feature-laravel-5.4 ( 556e60...89a18e )
by Kirill
03:48
created

DocsType::fields()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 37
Code Lines 26

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 26
nc 1
nop 0
dl 0
loc 37
rs 8.8571
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of laravel.su package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace App\GraphQL\Types;
10
11
use GraphQL\Type\Definition\Type;
12
13
/**
14
 * Class DocsType.
15
 */
16
class DocsType extends AbstractType
17
{
18
    /**
19
     * @var array
20
     */
21
    protected $attributes = [
22
        'name'        => 'Docs',
23
        'description' => 'Documentation repository',
24
    ];
25
26
    /**
27
     * @return array
28
     */
29
    public function fields(): array
30
    {
31
        return [
32
            'id'          => [
33
                'type'        => Type::nonNull(Type::id()),
34
                'description' => 'Docs identifier',
35
            ],
36
            'pages'       => [
37
                'type'        => Type::listOf(\GraphQL::type(DocsPageType::getName())),
38
                'description' => '',
39
            ],
40
            'title'       => [
41
                'type'        => Type::nonNull(Type::string()),
42
                'description' => '',
43
            ],
44
            'image'       => [
45
                'type'        => Type::nonNull(Type::string()),
46
                'description' => '',
47
            ],
48
            'version'     => [
49
                'type'        => Type::nonNull(Type::string()),
50
                'description' => '',
51
            ],
52
            'description' => [
53
                'type'        => Type::nonNull(Type::string()),
54
                'description' => '',
55
            ],
56
            'created_at'  => [
57
                'type'        => Type::nonNull(Type::string()),
58
                'description' => '',
59
            ],
60
            'updated_at'  => [
61
                'type'        => Type::nonNull(Type::string()),
62
                'description' => '',
63
            ],
64
        ];
65
    }
66
}
67