examples/04_bookstore/Schema/Type/BookType.php 1 location
|
@@ 18-31 (lines=14) @@
|
| 15 |
|
use Youshido\GraphQL\Type\Scalar\IntType; |
| 16 |
|
use Youshido\GraphQL\Type\Scalar\StringType; |
| 17 |
|
|
| 18 |
|
class BookType extends AbstractObjectType |
| 19 |
|
{ |
| 20 |
|
public function build($config) |
| 21 |
|
{ |
| 22 |
|
$config->addFields([ |
| 23 |
|
'id' => new IdType(), |
| 24 |
|
'title' => new StringType(), |
| 25 |
|
'year' => new IntType(), |
| 26 |
|
'isbn' => new StringType(), |
| 27 |
|
'author' => new AuthorType(), |
| 28 |
|
]); |
| 29 |
|
} |
| 30 |
|
|
| 31 |
|
} |
examples/04_bookstore/Schema/Type/CategoryType.php 1 location
|
@@ 17-28 (lines=12) @@
|
| 14 |
|
use Youshido\GraphQL\Type\Scalar\IdType; |
| 15 |
|
use Youshido\GraphQL\Type\Scalar\StringType; |
| 16 |
|
|
| 17 |
|
class CategoryType extends AbstractObjectType |
| 18 |
|
{ |
| 19 |
|
public function build($config) |
| 20 |
|
{ |
| 21 |
|
$config->addFields([ |
| 22 |
|
'id' => new IdType(), |
| 23 |
|
'title' => new StringType(), |
| 24 |
|
'authors' => new ListType(new AuthorType()), |
| 25 |
|
new CategoriesField(), |
| 26 |
|
]); |
| 27 |
|
} |
| 28 |
|
} |
| 29 |
|
|