Completed
Push — master ( 600f67...159739 )
by Alexandr
05:28
created

PageInfoType::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is a part of GraphQL project.
4
 *
5
 * @author Alexandr Viniychuk <[email protected]>
6
 * created: 2/23/17 4:19 PM
7
 */
8
9
namespace Youshido\GraphQL\Relay\Type;
10
11
12
use Youshido\GraphQL\Config\Object\ObjectTypeConfig;
13
use Youshido\GraphQL\Type\NonNullType;
14
use Youshido\GraphQL\Type\Object\AbstractObjectType;
15
use Youshido\GraphQL\Type\Scalar\BooleanType;
16
use Youshido\GraphQL\Type\Scalar\StringType;
17
18
class PageInfoType extends AbstractObjectType
19
{
20 1
    public function build($config)
21
    {
22 1
        $config->addFields([
23
            'hasNextPage'     => [
24 1
                'type'        => new NonNullType(new BooleanType()),
25 1
                'description' => 'When paginating forwards, are there more items?'
26
            ],
27
            'hasPreviousPage' => [
28 1
                'type'        => new NonNullType(new BooleanType()),
29 1
                'description' => 'When paginating backwards, are there more items?'
30
            ],
31
            'startCursor'     => [
32 1
                'type'        => new StringType(),
33 1
                'description' => 'When paginating backwards, the cursor to continue.'
34
            ],
35
            'endCursor'       => [
36 1
                'type'        => new StringType(),
37 1
                'description' => 'When paginating forwards, the cursor to continue.'
38
            ],
39
        ]);
40 1
    }
41
42 1
    public function getDescription()
43
    {
44 1
        return "Information about pagination in a connection.";
45
    }
46
47
}