Completed
Push — 2.0 ( 3d053b...00ad30 )
by Kirill
03:09
created

AuthUserType::fields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 9
rs 9.6666
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 AuthUserType
15
 * @package App\GraphQL\Types
16
 */
17
class AuthUserType extends UserType
18
{
19
    /**
20
     * @var array
21
     */
22
    protected $attributes = [
23
        'name'        => 'Auth',
24
        'description' => 'Authenticated user',
25
    ];
26
27
    /**
28
     * @return array
29
     */
30
    public function fields(): array
31
    {
32
        return array_merge(parent::fields(), [
33
            'token' => [
34
                'type'        => Type::string(),
35
                'description' => 'Authenticated user token',
36
            ],
37
        ]);
38
    }
39
}