Completed
Push — master ( eea4af...ac3565 )
by Alexandr
13:12
created

RecentBooksField   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 14
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 4 1
A resolve() 0 4 1
1
<?php
2
/**
3
 * This file is a part of GraphQL project.
4
 *
5
 * @author Alexandr Viniychuk <[email protected]>
6
 * created: 4/23/17 11:09 PM
7
 */
8
9
namespace Examples\BookStore\Schema\Field\Book;
10
11
12
use Examples\BookStore\DataProvider;
13
use Examples\BookStore\Schema\Type\BookType;
14
use Youshido\GraphQL\Execution\ResolveInfo;
15
use Youshido\GraphQL\Field\AbstractField;
16
use Youshido\GraphQL\Type\AbstractType;
17
use Youshido\GraphQL\Type\ListType\ListType;
18
use Youshido\GraphQL\Type\Object\AbstractObjectType;
19
20
class RecentBooksField extends AbstractField
21
{
22
    public function getType()
23
    {
24
        return new ListType(new BookType());
25
    }
26
27
    public function resolve($value, array $args, ResolveInfo $info)
28
    {
29
        return DataProvider::getBooks();
30
    }
31
32
33
}