Completed
Pull Request — master (#204)
by Ryan
11:34
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
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
}