Skip to content

Commit 7a75a73

Browse files
authored
Fixed Adapter class for compatibility with base ObjectType (#721)
1 parent 10c1197 commit 7a75a73

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

src/Mappers/Proxys/MutableAdapterTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ public function assertValid(): void
3939
$this->type->assertValid();
4040
}
4141

42-
public function jsonSerialize():string
42+
public function jsonSerialize(): string
4343
{
4444
return $this->type->jsonSerialize();
4545
}
4646

4747

48-
public function toString():string
48+
public function toString(): string
4949
{
5050
return $this->type->toString();
5151
}

src/Mappers/Proxys/MutableObjectTypeAdapter.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,11 @@
33

44
namespace TheCodingMachine\GraphQLite\Mappers\Proxys;
55

6-
use Exception;
7-
use GraphQL\Error\InvariantViolation;
8-
use GraphQL\Type\Definition\FieldDefinition;
96
use GraphQL\Type\Definition\InterfaceType;
107
use GraphQL\Type\Definition\ObjectType;
118
use GraphQL\Type\Definition\ResolveInfo;
12-
use GraphQL\Utils\Utils;
13-
use RuntimeException;
14-
use TheCodingMachine\GraphQLite\Types\MutableInterface;
159
use TheCodingMachine\GraphQLite\Types\MutableObjectType;
16-
use TheCodingMachine\GraphQLite\Types\NoFieldsException;
1710
use function assert;
18-
use function call_user_func;
19-
use function is_array;
20-
use function is_callable;
21-
use function is_string;
22-
use function sprintf;
2311

2412
/**
2513
* An adapter class (actually a proxy) that adds the "mutable" feature to any Webonyx ObjectType.
@@ -36,6 +24,7 @@ public function __construct(ObjectType $type, ?string $className = null)
3624
$this->type = $type;
3725
$this->className = $className;
3826
$this->name = $type->name;
27+
$this->description = $type->description;
3928
$this->config = $type->config;
4029
$this->astNode = $type->astNode;
4130
$this->extensionASTNodes = $type->extensionASTNodes;

0 commit comments

Comments
 (0)