Skip to content

Commit 833ed71

Browse files
committed
fix: Fix fixtures for custom output type
1 parent edb430e commit 833ed71

File tree

4 files changed

+43
-10
lines changed

4 files changed

+43
-10
lines changed

tests/Fixtures/Entities/Book.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace TheCodingMachine\GraphQLite\Bundle\Tests\Fixtures\Entities;
4+
5+
class Book
6+
{
7+
public function __construct(
8+
private readonly string $title
9+
)
10+
{
11+
}
12+
13+
public function getTitle(): string
14+
{
15+
return $this->title;
16+
}
17+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace TheCodingMachine\GraphQLite\Bundle\Tests\Fixtures\Types;
4+
5+
use GraphQL\Type\Definition\ObjectType;
6+
use GraphQL\Type\Definition\Type;
7+
8+
class CustomBookType extends ObjectType
9+
{
10+
public function __construct()
11+
{
12+
parent::__construct([
13+
'name' => 'Book',
14+
'description' => 'A book',
15+
'fields' => [
16+
'title' => [
17+
'type' => Type::nonNull(Type::string()),
18+
'description' => 'Book title',
19+
],
20+
],
21+
]);
22+
}
23+
24+
}

tests/Fixtures/Types/CustomOutputType.php

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/Fixtures/config/services.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ services:
2020
TheCodingMachine\GraphQLite\Bundle\Tests\NoSecurityBundleFixtures\:
2121
resource: '../../NoSecurityBundleFixtures/*'
2222

23-
TheCodingMachine\Graphqlite\Bundle\Tests\Fixtures\Types\CustomOutputType:
23+
TheCodingMachine\Graphqlite\Bundle\Tests\Fixtures\Types\CustomBookType:
2424
tags:
25-
- { name: 'graphql.output_type' }
25+
- { name: 'graphql.output_type', class: 'TheCodingMachine\GraphQLite\Bundle\Tests\Fixtures\Entities\Book' }
2626

2727
someService:
2828
class: stdClass

0 commit comments

Comments
 (0)