Completed
Push — master ( 34956e...ae96c2 )
by Quang
9s
created

AbstractNodeField   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 3 1
A getDescription() 0 3 1
1
<?php
2
3
namespace Digia\Lumen\GraphQL\Fields;
4
5
use Youshido\GraphQL\Config\Field\FieldConfig;
6
use Youshido\GraphQL\Type\NonNullType;
7
use Youshido\GraphQL\Type\Scalar\IdType;
8
9
abstract class AbstractNodeField extends AbstractEntityField
10
{
11
12
    /**
13
     * @inheritdoc
14
     */
15
    public function getDescription()
16
    {
17
        return 'Returns a node with the given ID.';
18
    }
19
20
    /**
21
     * @inheritdoc
22
     */
23
    public function build(FieldConfig $config)
24
    {
25
        $config->addArgument('id', new NonNullType(new IdType()));
26
    }
27
}
28