Skip to content

Commit 9e945eb

Browse files
authored
Fix PHPStan type error: assert InputType before passing to InputObjectField
1 parent 312ea63 commit 9e945eb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/Types/MutableInputObjectType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use GraphQL\Error\InvariantViolation;
88
use GraphQL\Type\Definition\InputObjectField;
99
use GraphQL\Type\Definition\InputObjectType;
10+
use GraphQL\Type\Definition\InputType;
1011
use GraphQL\Type\Definition\Type;
1112
use RuntimeException;
1213

@@ -92,6 +93,7 @@ public function getFields(): array
9293
foreach ($fieldDefinitions as $name => $fieldDefinition) {
9394
assert(is_string($name));
9495
if ($fieldDefinition instanceof Type) {
96+
assert($fieldDefinition instanceof InputType);
9597
$this->finalFields[$name] = new InputObjectField(['name' => $name, 'type' => $fieldDefinition]);
9698
} else {
9799
/** @phpstan-var InputObjectFieldConfig $fieldDefinition */

0 commit comments

Comments
 (0)