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

RecentBooksField::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
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
}