Skip to content

Commit

Permalink
Fixed Adapter class for compatibility with base ObjectType (#721)
Browse files Browse the repository at this point in the history
  • Loading branch information
oojacoboo authored Dec 18, 2024
1 parent 10c1197 commit 7a75a73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Mappers/Proxys/MutableAdapterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ public function assertValid(): void
$this->type->assertValid();
}

public function jsonSerialize():string
public function jsonSerialize(): string
{
return $this->type->jsonSerialize();
}


public function toString():string
public function toString(): string
{
return $this->type->toString();
}
Expand Down
13 changes: 1 addition & 12 deletions src/Mappers/Proxys/MutableObjectTypeAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,11 @@

namespace TheCodingMachine\GraphQLite\Mappers\Proxys;

use Exception;
use GraphQL\Error\InvariantViolation;
use GraphQL\Type\Definition\FieldDefinition;
use GraphQL\Type\Definition\InterfaceType;
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\ResolveInfo;
use GraphQL\Utils\Utils;
use RuntimeException;
use TheCodingMachine\GraphQLite\Types\MutableInterface;
use TheCodingMachine\GraphQLite\Types\MutableObjectType;
use TheCodingMachine\GraphQLite\Types\NoFieldsException;
use function assert;
use function call_user_func;
use function is_array;
use function is_callable;
use function is_string;
use function sprintf;

/**
* An adapter class (actually a proxy) that adds the "mutable" feature to any Webonyx ObjectType.
Expand All @@ -36,6 +24,7 @@ public function __construct(ObjectType $type, ?string $className = null)
$this->type = $type;
$this->className = $className;
$this->name = $type->name;
$this->description = $type->description;
$this->config = $type->config;
$this->astNode = $type->astNode;
$this->extensionASTNodes = $type->extensionASTNodes;
Expand Down

0 comments on commit 7a75a73

Please sign in to comment.