From 0fa43058276f10c491d3a0df10622ae084b1de91 Mon Sep 17 00:00:00 2001 From: murtukov Date: Mon, 30 Nov 2020 20:33:01 +0100 Subject: [PATCH] - Revert creating the 'getType' expression function - Fix AppVeyor --- .appveyor.yml | 3 ++- docs/definitions/expression-language.md | 11 ----------- .../ExpressionFunction/GraphQL/GetType.php | 16 ---------------- src/Resources/config/services.yaml | 2 ++ .../App/config/node/mapping/node_type.yml | 2 +- 5 files changed, 5 insertions(+), 29 deletions(-) delete mode 100644 src/ExpressionLanguage/ExpressionFunction/GraphQL/GetType.php diff --git a/.appveyor.yml b/.appveyor.yml index ec6dd5c1f..a2e7d228f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -11,7 +11,8 @@ init: install: - ps: Set-Service wuauserv -StartupType Manual - - cinst -y php composer + - cinst -y php --version=7.4 + - cinst -y composer - refreshenv - cd c:\tools\php74 - copy php.ini-production php.ini /Y diff --git a/docs/definitions/expression-language.md b/docs/definitions/expression-language.md index 03c5b1098..58938d6b8 100644 --- a/docs/definitions/expression-language.md +++ b/docs/definitions/expression-language.md @@ -25,7 +25,6 @@ All definition config entries can use expression language but it must be explici - [hasPermission](#haspermission) - [hasAnyPermission](#hasanypermission) - [getUser](#getuser) - - [getType](#gettype) - [Registered variables](#registered-variables) - [Private services](#private-services) - [Custom expression functions](#custom-expression-functions) @@ -321,16 +320,6 @@ Examples @=getUser().firstName === 'adam' ``` -### getType -**Signature**: getType(string $alias): GraphQL\Type\Definition\Type|null - -Returns a GraphQL type. - -Examples -```yaml -@=getType('Post') -``` - ## Registered variables: diff --git a/src/ExpressionLanguage/ExpressionFunction/GraphQL/GetType.php b/src/ExpressionLanguage/ExpressionFunction/GraphQL/GetType.php deleted file mode 100644 index cb245aad4..000000000 --- a/src/ExpressionLanguage/ExpressionFunction/GraphQL/GetType.php +++ /dev/null @@ -1,16 +0,0 @@ - "$this->gqlServices->getType($alias)" - ); - } -} diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index f01929c44..db17309c1 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -39,6 +39,8 @@ services: Overblog\GraphQLBundle\Resolver\TypeResolver: calls: - ["setDispatcher", ["@event_dispatcher"]] + tags: + - { name: overblog_graphql.service, alias: typeResolver } Overblog\GraphQLBundle\Transformer\ArgumentsTransformer: arguments: diff --git a/tests/Functional/App/config/node/mapping/node_type.yml b/tests/Functional/App/config/node/mapping/node_type.yml index 2c2bb6566..3d1242af9 100644 --- a/tests/Functional/App/config/node/mapping/node_type.yml +++ b/tests/Functional/App/config/node/mapping/node_type.yml @@ -1,4 +1,4 @@ Node: type: relay-node config: - resolveType: '@=getType(query("node_resolver::typeResolver", value))' + resolveType: '@=typeResolver.resolve(query("node_resolver::typeResolver", value))'