Completed
Push — 2.0 ( d39b3c...f2914f )
by Kirill
02:52
created

DocsPageType::fields()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 33
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 23
nc 1
nop 0
dl 0
loc 33
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 DocsPageType.
15
 */
16
class DocsPageType extends AbstractType
17
{
18
    /**
19
     * @var array
20
     */
21
    protected $attributes = [
22
        'name'        => 'Docs page',
23
        'description' => 'Page of documentation repository',
24
    ];
25
26
    /**
27
     * @return array
28
     */
29
    public function typeFields(): array
30
    {
31
        return [
32
            'id'             => [
33
                'type'        => Type::nonNull(Type::id()),
34
                'description' => 'Docs identifier',
35
            ],
36
            'title'          => [
37
                'type'        => Type::nonNull(Type::string()),
38
                'description' => '',
39
            ],
40
            'slug'           => [
41
                'type'        => Type::nonNull(Type::string()),
42
                'description' => '',
43
            ],
44
            'content'        => [
45
                'type'        => Type::nonNull(Type::string()),
46
                'description' => 'Page rendered content',
47
            ],
48
            'content_source' => [
49
                'type'        => Type::nonNull(Type::string()),
50
                'description' => 'Page content source (original)',
51
            ],
52
            'created_at'     => [
53
                'type'        => Type::nonNull(Type::string()),
54
                'description' => '',
55
            ],
56
            'updated_at'     => [
57
                'type'        => Type::nonNull(Type::string()),
58
                'description' => '',
59
            ],
60
        ];
61
    }
62
}
63