Completed
Push — graphql-auth ( 67a3fb...eab2f1 )
by
unknown
03:31
created

AuthType::fields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: dmitry
5
 * Date: 28.03.17
6
 * Time: 11:55
7
 */
8
9
namespace App\GraphQL\Types;
10
11
12
use GraphQL\Type\Definition\Type;
13
14
class AuthType extends UserType
15
{
16
    protected $attributes = [
17
        'name' => 'AuthType',
18
        'description' => 'Auth Object type'
19
    ];
20
21
    public function fields(): array
22
    {
23
        $fields = parent::fields();
24
        $fields['token'] = ['type' => Type::nonNull(Type::string()),
25
        'description' => 'User secret auth token'];
26
        return $fields;
27
    }
28
}