diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f021dde0..94e40e39e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ You can find and compare releases at the [GitHub release page](https://github.co ## Unreleased +## v15.15.0 + +### Added + +- Add field config decorator when building schema from SDL https://github.com/webonyx/graphql-php/pull/1590 + ## v15.14.3 ### Fixed diff --git a/src/Utils/ASTDefinitionBuilder.php b/src/Utils/ASTDefinitionBuilder.php index 96dbb47e6..9d18e801d 100644 --- a/src/Utils/ASTDefinitionBuilder.php +++ b/src/Utils/ASTDefinitionBuilder.php @@ -266,7 +266,7 @@ private function internalBuildType(string $typeName, ?Node $typeNode = null): Ty if (isset($this->typeDefinitionsMap[$typeName])) { $type = $this->makeSchemaDef($this->typeDefinitionsMap[$typeName]); - if (isset($this->typeConfigDecorator)) { + if ($this->typeConfigDecorator !== null) { try { $config = ($this->typeConfigDecorator)( $type->config, diff --git a/tests/Utils/BuildSchemaTest.php b/tests/Utils/BuildSchemaTest.php index 508d9369e..8867ec7cd 100644 --- a/tests/Utils/BuildSchemaTest.php +++ b/tests/Utils/BuildSchemaTest.php @@ -42,9 +42,7 @@ use GraphQL\Utils\SchemaPrinter; use GraphQL\Validator\Rules\KnownDirectives; -/** - * @phpstan-import-type UnnamedFieldDefinitionConfig from FieldDefinition - */ +/** @phpstan-import-type UnnamedFieldDefinitionConfig from FieldDefinition */ final class BuildSchemaTest extends TestCaseBase { use ArraySubsetAsserts; diff --git a/tests/Utils/SchemaExtenderTest.php b/tests/Utils/SchemaExtenderTest.php index 712328ccb..140924ac3 100644 --- a/tests/Utils/SchemaExtenderTest.php +++ b/tests/Utils/SchemaExtenderTest.php @@ -40,9 +40,7 @@ use GraphQL\Utils\SchemaPrinter; use GraphQL\Validator\Rules\KnownDirectives; -/** - * @phpstan-import-type UnnamedFieldDefinitionConfig from FieldDefinition - */ +/** @phpstan-import-type UnnamedFieldDefinitionConfig from FieldDefinition */ final class SchemaExtenderTest extends TestCaseBase { /** @param NamedType|Schema $obj */