RecentBooksField::getType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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\ListType\ListType;
17
18
class RecentBooksField extends AbstractField
19
{
20
    public function getType()
21
    {
22
        return new ListType(new BookType());
23
    }
24
25
    public function resolve($value, array $args, ResolveInfo $info)
26
    {
27
        return DataProvider::getBooks();
28
    }
29
30
31
}