From 84292875533a0b5ab43423b2500bd114b78c264d Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Wed, 11 Dec 2024 14:10:55 +0100 Subject: [PATCH 01/10] [TMP] Added ibexa dev-symfony-6 dependencies --- composer.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index c84e49a..0bc07ed 100644 --- a/composer.json +++ b/composer.json @@ -17,10 +17,10 @@ "php": " >=8.3", "ext-dom": "*", "erusev/parsedown": "^1.7", - "ibexa/admin-ui": "~5.0.x-dev", - "ibexa/core": "~5.0.x-dev", - "ibexa/fieldtype-richtext": "~5.0.x-dev", - "ibexa/rest": "~5.0.x-dev", + "ibexa/admin-ui": "dev-ibx-8470-symfony-6 as 5.0.x-dev", + "ibexa/core": "dev-ibx-8470-symfony-6 as 5.0.x-dev", + "ibexa/fieldtype-richtext": "dev-ibx-8470-symfony-6 as 5.0.x-dev", + "ibexa/rest": "dev-ibx-8470-symfony-6 as 5.0.x-dev", "lexik/jwt-authentication-bundle": "^2.8", "overblog/graphql-bundle": "^0.14.2", "symfony/config": "^5.0", @@ -34,13 +34,13 @@ }, "require-dev": { "ibexa/code-style": "~2.0.0", - "ibexa/content-forms": "~5.0.x-dev", - "ibexa/design-engine": "~5.0.x-dev", - "ibexa/doctrine-schema": "~5.0.x-dev", - "ibexa/http-cache": "~5.0.x-dev", - "ibexa/notifications": "~5.0.x-dev", - "ibexa/search": "~5.0.x-dev", - "ibexa/user": "~5.0.x-dev", + "ibexa/content-forms": "dev-ibx-8470-symfony-6 as 5.0.x-dev", + "ibexa/design-engine": "dev-ibx-8470-symfony-6 as 5.0.x-dev", + "ibexa/doctrine-schema": "dev-ibx-8470-symfony-6 as 5.0.x-dev", + "ibexa/http-cache": "dev-ibx-8470-symfony-6 as 5.0.x-dev", + "ibexa/notifications": "dev-ibx-8470-symfony-6 as 5.0.x-dev", + "ibexa/search": "dev-ibx-8470-symfony-6 as 5.0.x-dev", + "ibexa/user": "dev-ibx-8470-symfony-6 as 5.0.x-dev", "mikey179/vfsstream": "^1.6", "overblog/graphiql-bundle": "^0.2", "phpspec/phpspec": "^7.1", From 635da6b8f5d7e9eaf3cbda888cafefd7c23bb530 Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Wed, 11 Dec 2024 14:12:10 +0100 Subject: [PATCH 02/10] IBX-8470: Upgraded dependencies to symfony6 + compatible with it --- composer.json | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 0bc07ed..9009782 100644 --- a/composer.json +++ b/composer.json @@ -22,15 +22,15 @@ "ibexa/fieldtype-richtext": "dev-ibx-8470-symfony-6 as 5.0.x-dev", "ibexa/rest": "dev-ibx-8470-symfony-6 as 5.0.x-dev", "lexik/jwt-authentication-bundle": "^2.8", - "overblog/graphql-bundle": "^0.14.2", - "symfony/config": "^5.0", - "symfony/console": "^5.0", - "symfony/dependency-injection": "^5.0", - "symfony/filesystem": "^5.0", - "symfony/http-foundation": "^5.0", - "symfony/http-kernel": "^5.0", - "symfony/serializer": "^5.0", - "symfony/yaml": "^5.0" + "overblog/graphql-bundle": "^1.6.0", + "symfony/config": "^6.4", + "symfony/console": "^6.4", + "symfony/dependency-injection": "^6.4", + "symfony/filesystem": "^6.4", + "symfony/http-foundation": "^6.4", + "symfony/http-kernel": "^6.4", + "symfony/serializer": "^6.4", + "symfony/yaml": "^6.4" }, "require-dev": { "ibexa/code-style": "~2.0.0", @@ -42,7 +42,7 @@ "ibexa/search": "dev-ibx-8470-symfony-6 as 5.0.x-dev", "ibexa/user": "dev-ibx-8470-symfony-6 as 5.0.x-dev", "mikey179/vfsstream": "^1.6", - "overblog/graphiql-bundle": "^0.2", + "overblog/graphiql-bundle": "^1.0", "phpspec/phpspec": "^7.1", "phpstan/phpstan": "^1.10", "phpstan/phpstan-phpunit": "^1.3", @@ -65,9 +65,6 @@ "spec\\EzSystems\\EzPlatformGraphQL\\": "spec/EzSystems/EzPlatformGraphQL" } }, - "conflict": { - "webonyx/graphql-php": ">= 15.0.0" - }, "extra": { "branch-alias": { "dev-main": "5.0.x-dev" From fd68e8712ff71a4fa947db42355f3f57369ec3ce Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Wed, 11 Dec 2024 14:23:04 +0100 Subject: [PATCH 03/10] IBX-8470: Fixed phpstan issues after upgrade --- phpstan-baseline.neon | 100 ---------------------- src/lib/Relay/DomainConnectionBuilder.php | 15 ---- src/lib/Relay/PageAwareConnection.php | 61 ++++++++++--- src/lib/Relay/SearchResolver.php | 16 ++-- src/lib/Resolver/ItemResolver.php | 13 ++- src/lib/Resolver/LocationResolver.php | 2 +- 6 files changed, 65 insertions(+), 142 deletions(-) delete mode 100644 src/lib/Relay/DomainConnectionBuilder.php diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index ece6d89..e5cd1d1 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -10,31 +10,6 @@ parameters: count: 1 path: src/bundle/Command/GeneratePlatformSchemaCommand.php - - - message: "#^Method Ibexa\\\\Bundle\\\\GraphQL\\\\Command\\\\GeneratePlatformSchemaCommand\\:\\:configure\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/Command/GeneratePlatformSchemaCommand.php - - - - message: "#^Method Ibexa\\\\Bundle\\\\GraphQL\\\\DependencyInjection\\\\Compiler\\\\FieldInputHandlersPass\\:\\:process\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/DependencyInjection/Compiler/FieldInputHandlersPass.php - - - - message: "#^Method Ibexa\\\\Bundle\\\\GraphQL\\\\DependencyInjection\\\\Compiler\\\\RichTextInputConvertersPass\\:\\:process\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/DependencyInjection/Compiler/RichTextInputConvertersPass.php - - - - message: "#^Method Ibexa\\\\Bundle\\\\GraphQL\\\\DependencyInjection\\\\Compiler\\\\SchemaDomainIteratorsPass\\:\\:process\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/DependencyInjection/Compiler/SchemaDomainIteratorsPass.php - - - - message: "#^Method Ibexa\\\\Bundle\\\\GraphQL\\\\DependencyInjection\\\\Compiler\\\\SchemaWorkersPass\\:\\:process\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/DependencyInjection/Compiler/SchemaWorkersPass.php - - message: "#^Method Ibexa\\\\Bundle\\\\GraphQL\\\\DependencyInjection\\\\GraphQL\\\\SchemaProvider\\:\\:getSchemaConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -100,11 +75,6 @@ parameters: count: 1 path: src/bundle/DependencyInjection/IbexaGraphQLExtension.php - - - message: "#^Method Ibexa\\\\Bundle\\\\GraphQL\\\\DependencyInjection\\\\IbexaGraphQLExtension\\:\\:prepend\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/DependencyInjection/IbexaGraphQLExtension.php - - message: "#^Parameter \\#1 \\$configDir of method Ibexa\\\\Bundle\\\\GraphQL\\\\DependencyInjection\\\\IbexaGraphQLExtension\\:\\:getGraphQLConfig\\(\\) expects string, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" count: 1 @@ -115,11 +85,6 @@ parameters: count: 1 path: src/bundle/DependencyInjection/IbexaGraphQLExtension.php - - - message: "#^Method Ibexa\\\\Bundle\\\\GraphQL\\\\IbexaGraphQLBundle\\:\\:build\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/IbexaGraphQLBundle.php - - message: "#^Method Ibexa\\\\Contracts\\\\GraphQL\\\\Mutation\\\\InputHandler\\\\FieldType\\\\RichText\\\\RichTextInputConverter\\:\\:convertToXml\\(\\) has parameter \\$text with no type specified\\.$#" count: 1 @@ -540,56 +505,11 @@ parameters: count: 1 path: src/lib/Relay/NodeResolver.php - - - message: "#^Access to protected property Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\Output\\\\Connection\\:\\:\\$edges\\.$#" - count: 1 - path: src/lib/Relay/PageAwareConnection.php - - - - message: "#^Access to protected property Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\Output\\\\Connection\\:\\:\\$pageInfo\\.$#" - count: 1 - path: src/lib/Relay/PageAwareConnection.php - - - - message: "#^Access to protected property Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\Output\\\\Connection\\:\\:\\$totalCount\\.$#" - count: 1 - path: src/lib/Relay/PageAwareConnection.php - - - - message: "#^Method Ibexa\\\\GraphQL\\\\Relay\\\\PageAwareConnection\\:\\:__construct\\(\\) has parameter \\$edges with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Relay/PageAwareConnection.php - - - - message: "#^Parameter \\#2 \\$pageInfo of class Ibexa\\\\GraphQL\\\\Relay\\\\PageAwareConnection constructor expects Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\PageInfoInterface, Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\PageInfoInterface\\|null given\\.$#" - count: 1 - path: src/lib/Relay/PageAwareConnection.php - - - - message: "#^Property Ibexa\\\\GraphQL\\\\Relay\\\\PageAwareConnection\\:\\:\\$totalCount \\(int\\) does not accept GraphQL\\\\Executor\\\\Promise\\\\Promise\\|int\\|null\\.$#" - count: 1 - path: src/lib/Relay/PageAwareConnection.php - - - - message: "#^Access to an undefined property Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\ConnectionInterface\\:\\:\\$sliceSize\\.$#" - count: 1 - path: src/lib/Relay/SearchResolver.php - - message: "#^Method Ibexa\\\\GraphQL\\\\Relay\\\\SearchResolver\\:\\:searchContent\\(\\) has parameter \\$args with no type specified\\.$#" count: 1 path: src/lib/Relay/SearchResolver.php - - - message: "#^Method Ibexa\\\\GraphQL\\\\Relay\\\\SearchResolver\\:\\:searchContent\\(\\) should return Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\Output\\\\Connection but returns Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\ConnectionInterface\\.$#" - count: 1 - path: src/lib/Relay/SearchResolver.php - - - - message: "#^Method Ibexa\\\\GraphQL\\\\Relay\\\\SearchResolver\\:\\:searchContent\\(\\) should return Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\Output\\\\Connection but returns null\\.$#" - count: 1 - path: src/lib/Relay/SearchResolver.php - - message: "#^Method Ibexa\\\\GraphQL\\\\Resolver\\\\ContentResolver\\:\\:findContentByType\\(\\) has no return type specified\\.$#" count: 1 @@ -980,16 +900,6 @@ parameters: count: 1 path: src/lib/Resolver/ItemResolver.php - - - message: "#^Method Ibexa\\\\GraphQL\\\\Resolver\\\\ItemResolver\\:\\:resolveItemsOfTypeAsConnection\\(\\) should return Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\Output\\\\Connection but returns GraphQL\\\\Executor\\\\Promise\\\\Promise\\|Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\Output\\\\Connection\\.$#" - count: 1 - path: src/lib/Resolver/ItemResolver.php - - - - message: "#^Property Ibexa\\\\GraphQL\\\\Resolver\\\\ItemResolver\\:\\:\\$contentTypeLoader is never read, only written\\.$#" - count: 1 - path: src/lib/Resolver/ItemResolver.php - - message: "#^Parameter \\#1 \\$location of method Ibexa\\\\GraphQL\\\\Resolver\\\\LocationGuesser\\\\ObjectStorageLocationList\\:\\:addLocation\\(\\) expects Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location, Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ValueObject given\\.$#" count: 1 @@ -1065,16 +975,6 @@ parameters: count: 1 path: src/lib/Resolver/LocationResolver.php - - - message: "#^PHPDoc tag @return with type Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\Output\\\\Connection is incompatible with native type Ibexa\\\\GraphQL\\\\Relay\\\\PageAwareConnection\\.$#" - count: 1 - path: src/lib/Resolver/LocationResolver.php - - - - message: "#^Parameter \\#1 \\$connection of static method Ibexa\\\\GraphQL\\\\Relay\\\\PageAwareConnection\\:\\:fromConnection\\(\\) expects Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\Output\\\\Connection, GraphQL\\\\Executor\\\\Promise\\\\Promise\\|Overblog\\\\GraphQLBundle\\\\Relay\\\\Connection\\\\Output\\\\Connection given\\.$#" - count: 1 - path: src/lib/Resolver/LocationResolver.php - - message: "#^Method Ibexa\\\\GraphQL\\\\Resolver\\\\ObjectStateGroupResolver\\:\\:resolveObjectStateGroups\\(\\) should return array\\ but returns iterable\\\\.$#" count: 1 diff --git a/src/lib/Relay/DomainConnectionBuilder.php b/src/lib/Relay/DomainConnectionBuilder.php deleted file mode 100644 index 46b509c..0000000 --- a/src/lib/Relay/DomainConnectionBuilder.php +++ /dev/null @@ -1,15 +0,0 @@ -> */ + public iterable $edges = []; - /** @var \Overblog\GraphQLBundle\Relay\Connection\PageInfoInterface */ - public $pageInfo; + public PageInfoInterface $pageInfo; /** @var int */ - public $totalCount; + public int $totalCount; /** @var Page[] */ - public $pages; + public array $pages; - public function __construct(array $edges, PageInfoInterface $pageInfo) + /** + * @param iterable<\Overblog\GraphQLBundle\Relay\Connection\EdgeInterface> $edges + */ + public function __construct(iterable $edges, PageInfoInterface $pageInfo) { $this->edges = $edges; $this->pageInfo = $pageInfo; } - public static function fromConnection(Connection $connection, Argument $args): PageAwareConnection + /** + * @param \GraphQL\Executor\Promise\Promise|\Overblog\GraphQLBundle\Relay\Connection\ConnectionInterface $connection + * + * @return \Ibexa\GraphQL\Relay\PageAwareConnection + */ + public static function fromConnection(ConnectionInterface|Promise $connection, Argument $args): PageAwareConnection { - $return = new self($connection->edges, $connection->pageInfo); - $return->totalCount = $connection->totalCount; + $connection = self::resolvePromise( + $connection, + fn($resolved) => $resolved instanceof ConnectionInterface, + 'Resolved result is not a ConnectionInterface' + ); + + $return = new self($connection->getEdges(), $connection->getPageInfo()); + + $totalCount = self::resolvePromise( + $connection->getTotalCount(), + fn($resolved) => is_int($resolved) || is_null($resolved), + 'Resolved result is not an int or null' + ); + + $return->totalCount = (int)$totalCount; $return->pages = []; @@ -49,4 +76,18 @@ public static function fromConnection(Connection $connection, Argument $args): P return $return; } + + private static function resolvePromise(mixed $value, callable $validator, string $errorMessage): mixed + { + if ($value instanceof Promise) { + $promiseAdapter = new SyncPromiseAdapter(); + $resolvedValue = $promiseAdapter->wait($value); + + if (!$validator($resolvedValue)) { + throw new \UnexpectedValueException($errorMessage); + } + return $resolvedValue; + } + return $value; + } } diff --git a/src/lib/Relay/SearchResolver.php b/src/lib/Relay/SearchResolver.php index 5f49c41..3116e07 100644 --- a/src/lib/Relay/SearchResolver.php +++ b/src/lib/Relay/SearchResolver.php @@ -11,6 +11,7 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Query; use Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchHit; use Overblog\GraphQLBundle\Relay\Connection\ConnectionBuilder; +use Overblog\GraphQLBundle\Relay\Connection\ConnectionInterface; class SearchResolver { @@ -27,11 +28,11 @@ public function __construct(SearchService $searchService) /** * @param $args * - * @return \Overblog\GraphQLBundle\Relay\Connection\Output\Connection + * @return \Overblog\GraphQLBundle\Relay\Connection\ConnectionInterface<\Ibexa\Contracts\Core\Repository\Values\ValueObject> * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException */ - public function searchContent($args) + public function searchContent($args): ConnectionInterface { $queryArg = $args['query']; @@ -48,10 +49,9 @@ public function searchContent($args) } } - if (count($criteria) === 0) { - return null; + if (count($criteria) !== 0) { + $query->filter = count($criteria) > 1 ? new Query\Criterion\LogicalAnd($criteria) : $criteria[0]; } - $query->filter = count($criteria) > 1 ? new Query\Criterion\LogicalAnd($criteria) : $criteria[0]; $searchResult = $this->searchService->findContentInfo($query); $contentItems = array_map( @@ -62,7 +62,8 @@ static function (SearchHit $hit) { ); $connectionBuilder = new ConnectionBuilder(); - $connection = $connectionBuilder->connectionFromArraySlice( + + return $connectionBuilder->connectionFromArraySlice( $contentItems, $args, [ @@ -70,8 +71,5 @@ static function (SearchHit $hit) { 'arrayLength' => $searchResult->totalCount, ] ); - $connection->sliceSize = count($contentItems); - - return $connection; } } diff --git a/src/lib/Resolver/ItemResolver.php b/src/lib/Resolver/ItemResolver.php index e24c694..679c5d5 100644 --- a/src/lib/Resolver/ItemResolver.php +++ b/src/lib/Resolver/ItemResolver.php @@ -8,6 +8,7 @@ namespace Ibexa\GraphQL\Resolver; use GraphQL\Error\UserError; +use GraphQL\Executor\Promise\Promise; use Ibexa\Contracts\Core\Repository\Values\Content\Content; use Ibexa\Contracts\Core\Repository\Values\Content\Query; use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType; @@ -37,9 +38,6 @@ final class ItemResolver /** @var \Ibexa\GraphQL\DataLoader\ContentLoader */ private $contentLoader; - /** @var \Ibexa\GraphQL\DataLoader\ContentTypeLoader */ - private $contentTypeLoader; - /** @var \Ibexa\GraphQL\DataLoader\LocationLoader */ private $locationLoader; @@ -50,14 +48,12 @@ public function __construct( TypeResolver $typeResolver, QueryMapper $queryMapper, ContentLoader $contentLoader, - ContentTypeLoader $contentTypeLoader, LocationLoader $locationLoader, ItemFactory $currentSiteItemFactory ) { $this->typeResolver = $typeResolver; $this->queryMapper = $queryMapper; $this->contentLoader = $contentLoader; - $this->contentTypeLoader = $contentTypeLoader; $this->locationLoader = $locationLoader; $this->itemFactory = $currentSiteItemFactory; } @@ -99,7 +95,7 @@ public function resolveItem($args): Item ); } elseif (isset($args['contentId'])) { $item = $this->itemFactory->fromContent( - $content = $this->contentLoader->findSingle(new Query\Criterion\ContentId($args['contentId'])) + $this->contentLoader->findSingle(new Query\Criterion\ContentId($args['contentId'])) ); } elseif (isset($args['remoteId'])) { $item = $this->itemFactory->fromContent( @@ -129,7 +125,10 @@ public function resolveItemFieldValue(Item $item, $fieldDefinitionIdentifier, $a return Field::fromField($item->getContent()->getField($fieldDefinitionIdentifier, $args['language'] ?? null)); } - public function resolveItemsOfTypeAsConnection(string $contentTypeIdentifier, $args): Connection + /** + * @return \GraphQL\Executor\Promise\Promise|\Overblog\GraphQLBundle\Relay\Connection\Output\Connection<\Ibexa\GraphQL\Value\Item> + */ + public function resolveItemsOfTypeAsConnection(string $contentTypeIdentifier, $args): Connection|Promise { $query = $args['query'] ?: []; $query['ContentTypeIdentifier'] = $contentTypeIdentifier; diff --git a/src/lib/Resolver/LocationResolver.php b/src/lib/Resolver/LocationResolver.php index bcaad39..5e41e7e 100644 --- a/src/lib/Resolver/LocationResolver.php +++ b/src/lib/Resolver/LocationResolver.php @@ -86,7 +86,7 @@ public function resolveLocationById($locationId) /** * @param int $locationId * - * @return \Overblog\GraphQLBundle\Relay\Connection\Output\Connection + * @return \Ibexa\GraphQL\Relay\PageAwareConnection<\Ibexa\Contracts\Core\Repository\Values\Content\Location> */ public function resolveLocationChildren($locationId, Argument $args): PageAwareConnection { From ccfd4dcdb54f131fade4115ef9ce5604b7966c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Sat, 28 Dec 2024 14:14:26 +0100 Subject: [PATCH 04/10] Removed deprecated resolver_maps configuration option usage --- .../DependencyInjection/GraphQL/YamlSchemaProvider.php | 1 - src/bundle/Resources/config/services/resolvers.yaml | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bundle/DependencyInjection/GraphQL/YamlSchemaProvider.php b/src/bundle/DependencyInjection/GraphQL/YamlSchemaProvider.php index 4062e48..e55875f 100644 --- a/src/bundle/DependencyInjection/GraphQL/YamlSchemaProvider.php +++ b/src/bundle/DependencyInjection/GraphQL/YamlSchemaProvider.php @@ -37,7 +37,6 @@ public function getSchemaConfiguration() return [ 'query' => $this->getQuerySchema(), 'mutation' => $this->getMutationSchema(), - 'resolver_maps' => [UploadMap::class], 'types' => ['UntypedContent'], ]; } diff --git a/src/bundle/Resources/config/services/resolvers.yaml b/src/bundle/Resources/config/services/resolvers.yaml index e4ba3b5..dc0f948 100644 --- a/src/bundle/Resources/config/services/resolvers.yaml +++ b/src/bundle/Resources/config/services/resolvers.yaml @@ -187,4 +187,7 @@ services: - { name: overblog_graphql.mutation, alias: "DeleteDomainContent", method: "deleteDomainContent" } - { name: overblog_graphql.mutation, alias: "UpdateDomainContent", method: "updateDomainContent" } - Ibexa\GraphQL\Resolver\Map\UploadMap: ~ + Ibexa\GraphQL\Resolver\Map\UploadMap: + tags: + - name: overblog_graphql.resolver_map + schema: default From a7c66c18cf2a123432f0b1d19045c581efc5b547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Sat, 28 Dec 2024 15:15:47 +0100 Subject: [PATCH 05/10] Replaced deprecated resolver expression function usage --- .../Resources/config/default_settings.yaml | 2 +- .../Resources/config/graphql/Base.types.yaml | 2 +- .../config/graphql/Content.types.yaml | 20 +++++++++---------- .../config/graphql/ContentType.types.yaml | 8 ++++---- .../config/graphql/DomainContent.types.yaml | 10 +++++----- .../Resources/config/graphql/Field.types.yaml | 12 +++++------ .../config/graphql/FieldDefinition.types.yaml | 2 +- .../Resources/config/graphql/Item.types.yaml | 8 ++++---- .../config/graphql/Location.types.yaml | 8 ++++---- .../Resources/config/graphql/Node.types.yaml | 2 +- .../graphql/ObjectStateGroup.types.yaml | 2 +- .../config/graphql/Platform.types.yaml | 4 ++-- .../config/graphql/Repository.types.yaml | 14 ++++++------- .../config/graphql/UrlAlias.types.yaml | 4 ++-- .../Resources/config/graphql/User.types.yaml | 8 ++++---- .../config/graphql/Version.types.yaml | 2 +- .../RelationFieldDefinitionMapper.php | 2 +- .../FieldDefinition/ResolverVariables.php | 2 +- .../SelectionFieldDefinitionMapper.php | 2 +- .../AddItemOfTypeConnectionToGroup.php | 2 +- .../Worker/ContentType/AddItemToGroup.php | 2 +- .../AddItemTypeToItemGroupTypes.php | 2 +- .../AddDomainGroupToDomain.php | 2 +- 23 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/bundle/Resources/config/default_settings.yaml b/src/bundle/Resources/config/default_settings.yaml index 18aad66..d3cc8a4 100644 --- a/src/bundle/Resources/config/default_settings.yaml +++ b/src/bundle/Resources/config/default_settings.yaml @@ -46,7 +46,7 @@ parameters: input_type: ImageFieldInput ezimageasset: value_type: ImageFieldValue - value_resolver: 'resolver("DomainImageAssetFieldValue", [field])' + value_resolver: 'query("DomainImageAssetFieldValue", [field])' ezinteger: definition_type: IntegerFieldDefinition value_type: Int diff --git a/src/bundle/Resources/config/graphql/Base.types.yaml b/src/bundle/Resources/config/graphql/Base.types.yaml index 2355da8..1745f2e 100644 --- a/src/bundle/Resources/config/graphql/Base.types.yaml +++ b/src/bundle/Resources/config/graphql/Base.types.yaml @@ -23,7 +23,7 @@ DateTime: format: type: String description: "Date formatted with a date() format" - resolve: "@=resolver('DateTimeFormat', [value, args])" + resolve: "@=query('DateTimeFormat', [value, args])" args: pattern: type: "String" diff --git a/src/bundle/Resources/config/graphql/Content.types.yaml b/src/bundle/Resources/config/graphql/Content.types.yaml index c84c4df..857a3b5 100644 --- a/src/bundle/Resources/config/graphql/Content.types.yaml +++ b/src/bundle/Resources/config/graphql/Content.types.yaml @@ -12,25 +12,25 @@ Content: contentType: type: "ContentType" description: "The content type of the Content item." - resolve: "@=resolver('ContentTypeById', [value.contentTypeId])" + resolve: "@=query('ContentTypeById', [value.contentTypeId])" name: type: "String" description: "The computed name (via name schema) in the main language of the Content item." section: type: "Section" description: "The section to which the Content object is assigned." - resolve: "@=resolver('SectionById', [value.sectionId])" + resolve: "@=query('SectionById', [value.sectionId])" currentVersionNo: type: "Int" description: "Version number of the published version, or 1 for a newly created draft." currentVersion: type: "Version" description: "The currently published version" - resolve: "@=resolver('CurrentVersion', [value])" + resolve: "@=query('CurrentVersion', [value])" versions: type: "[Version]" description: "All content versions." - resolve: "@=resolver('ContentVersions', [value.id])" + resolve: "@=query('ContentVersions', [value.id])" published: type: "Boolean" description: "If the Content item has a published version." @@ -40,7 +40,7 @@ Content: owner: type: "User" description: "The owner user of the Content object" - resolve: "@=resolver('UserById', [value.ownerId])" + resolve: "@=query('UserById', [value.ownerId])" modificationDate: type: DateTime description: "Date the Content item was last modified on." @@ -62,23 +62,23 @@ Content: mainLocation: type: "Location" description: "Content item's main location." - resolve: "@=resolver('LocationById', [value.mainLocationId])" + resolve: "@=query('LocationById', [value.mainLocationId])" locations: type: "[Location]" description: "All the locations of the Content item" - resolve: "@=resolver('LocationsByContentId', [value.id])" + resolve: "@=query('LocationsByContentId', [value.id])" relations: type: "[ContentRelation]" description: "Relations from this Content" - resolve: "@=resolver('ContentRelations', [value])" + resolve: "@=query('ContentRelations', [value])" reverseRelations: type: "[ContentRelation]" description: "Relations to this Content" - resolve: "@=resolver('ContentReverseRelations', [value])" + resolve: "@=query('ContentReverseRelations', [value])" states: type: "[ObjectState]" description: "Content States." - resolve: "@=resolver('ObjectStateByContentInfo', [value])" + resolve: "@=query('ObjectStateByContentInfo', [value])" ContentRelation: type: "object" diff --git a/src/bundle/Resources/config/graphql/ContentType.types.yaml b/src/bundle/Resources/config/graphql/ContentType.types.yaml index 8232188..022ab80 100644 --- a/src/bundle/Resources/config/graphql/ContentType.types.yaml +++ b/src/bundle/Resources/config/graphql/ContentType.types.yaml @@ -47,14 +47,14 @@ ContentType: creator: type: "User" description: "The user who created this content type." - resolve: "@=resolver('UserById', [value.creatorId])" + resolve: "@=query('UserById', [value.creatorId])" modifierId: type: "Int" description: "The user id of the user which has last modified this content type" modifier: type: "User" description: "The user which has last modified this content type" - resolve: "@=resolver('UserById', [value.modifierId])" + resolve: "@=query('UserById', [value.modifierId])" remoteId: type: "String" description: "A global unique id of the content type." @@ -99,12 +99,12 @@ ContentTypeGroup: type: "Int" creator: type: "User" - resolve: "@=resolver('UserById', [value.creatorId])" + resolve: "@=query('UserById', [value.creatorId])" modifierId: type: "Int" modifier: type: "User" - resolve: "@=resolver('UserById', [value.modifierId])" + resolve: "@=query('UserById', [value.modifierId])" contentTypes: type: "[ContentType]" resolve: "@=query('ContentTypesFromGroup', {'groupId': value.id})" diff --git a/src/bundle/Resources/config/graphql/DomainContent.types.yaml b/src/bundle/Resources/config/graphql/DomainContent.types.yaml index 8aa38ba..ea89fc7 100644 --- a/src/bundle/Resources/config/graphql/DomainContent.types.yaml +++ b/src/bundle/Resources/config/graphql/DomainContent.types.yaml @@ -29,7 +29,7 @@ DomainContent: type: String _thumbnail: type: Thumbnail - resolveType: "@=resolver('DomainContentType', [value])" + resolveType: "@=query('DomainContentType', [value])" AbstractDomainContent: type: "object" @@ -44,7 +44,7 @@ AbstractDomainContent: _type: description: "The item's content type" type: ContentType - resolve: '@=resolver("ContentTypeById", [value.contentInfo.contentTypeId])' + resolve: '@=query("ContentTypeById", [value.contentInfo.contentTypeId])' _content: description: 'Underlying content info item' type: Content @@ -57,11 +57,11 @@ AbstractDomainContent: _location: description: 'Main location' type: Location - resolve: '@=resolver("LocationById", [value.contentInfo.mainLocationId])' + resolve: '@=query("LocationById", [value.contentInfo.mainLocationId])' _allLocations: description: 'All the locations' type: '[Location]' - resolve: '@=resolver("LocationsByContentId", [value.contentInfo.id])' + resolve: '@=query("LocationsByContentId", [value.contentInfo.id])' _name: description: "The content item's name, in the prioritized language(s), based on the object name pattern" type: String @@ -69,7 +69,7 @@ AbstractDomainContent: _url: description: "The content item's url alias, based on the main location." type: String - resolve: "@=resolver('MainUrlAlias', [value])" + resolve: "@=query('MainUrlAlias', [value])" _thumbnail: type: Thumbnail resolve: "@=query('Thumbnail', value.getThumbnail())" diff --git a/src/bundle/Resources/config/graphql/Field.types.yaml b/src/bundle/Resources/config/graphql/Field.types.yaml index f413872..08a8d08 100644 --- a/src/bundle/Resources/config/graphql/Field.types.yaml +++ b/src/bundle/Resources/config/graphql/Field.types.yaml @@ -45,14 +45,14 @@ ImageFieldValue: identifier: type: "[ImageVariationIdentifier]!" description: "One or more variation identifiers." - resolve: "@=resolver('ImageVariations', [value.value, args])" + resolve: "@=query('ImageVariations', [value.value, args])" variation: type: ImageVariation args: identifier: type: ImageVariationIdentifier! description: "A variation identifier." - resolve: "@=resolver('ImageVariation', [value.value, args])" + resolve: "@=query('ImageVariation', [value.value, args])" ImageAdditionalData: type: object @@ -139,7 +139,7 @@ DateFieldValue: formatted: type: "String" description: "Formatted date" - resolve: "@=resolver('DateTimeFormat', [args['format'], value.value])" + resolve: "@=query('DateTimeFormat', [args['format'], value.value])" args: format: type: String @@ -248,15 +248,15 @@ RichTextFieldValue: plaintext: type: "String" description: "Plain text representation of the value, without tags. Warning: the text representation may not be perfect." - resolve: "@=resolver('RichTextXmlToPlainText', [value.xml])" + resolve: "@=query('RichTextXmlToPlainText', [value.xml])" html5: type: "String" description: "HTML5 representation." - resolve: "@=resolver('RichTextXmlToHtml5', [value.xml])" + resolve: "@=query('RichTextXmlToHtml5', [value.xml])" html5_edit: type: "String" description: "Editable HTML5 representation." - resolve: "@=resolver('RichTextXmlToHtml5Edit', [value.xml])" + resolve: "@=query('RichTextXmlToHtml5Edit', [value.xml])" SelectionFieldValue: type: object diff --git a/src/bundle/Resources/config/graphql/FieldDefinition.types.yaml b/src/bundle/Resources/config/graphql/FieldDefinition.types.yaml index 989ced6..3aeb8bf 100644 --- a/src/bundle/Resources/config/graphql/FieldDefinition.types.yaml +++ b/src/bundle/Resources/config/graphql/FieldDefinition.types.yaml @@ -194,7 +194,7 @@ SelectionFieldDefinitionSettings: type: Boolean options: type: "[SelectionFieldDefinitionOption]" - resolve: "@=resolver('SelectionFieldDefinitionOptions', [value['options']])" + resolve: "@=query('SelectionFieldDefinitionOptions', [value['options']])" SelectionFieldDefinitionOption: type: object diff --git a/src/bundle/Resources/config/graphql/Item.types.yaml b/src/bundle/Resources/config/graphql/Item.types.yaml index 2aaeec5..3f38a09 100644 --- a/src/bundle/Resources/config/graphql/Item.types.yaml +++ b/src/bundle/Resources/config/graphql/Item.types.yaml @@ -22,7 +22,7 @@ Item: type: String _thumbnail: type: Thumbnail - resolveType: "@=resolver('ItemType', [value])" + resolveType: "@=query('ItemType', [value])" AbstractItem: type: "object" @@ -37,7 +37,7 @@ AbstractItem: _type: description: "The item's content type" type: ContentType - resolve: '@=resolver("ContentTypeById", [value.getContentInfo().contentTypeId])' + resolve: '@=query("ContentTypeById", [value.getContentInfo().contentTypeId])' _contentInfo: description: 'Underlying content info item' type: Content @@ -49,7 +49,7 @@ AbstractItem: _allLocations: description: 'All the locations' type: '[Location]' - resolve: '@=resolver("LocationsByContentId", [value.getContentInfo().id])' + resolve: '@=query("LocationsByContentId", [value.getContentInfo().id])' _name: description: "The content item's name, in the prioritized language(s), based on the object name pattern" type: String @@ -57,7 +57,7 @@ AbstractItem: _url: description: "The content item's url alias, based on the main location." type: String - resolve: "@=resolver('ItemUrlAlias', [value])" + resolve: "@=query('ItemUrlAlias', [value])" _thumbnail: type: Thumbnail resolve: "@=query('Thumbnail', value.getContent().getThumbnail())" diff --git a/src/bundle/Resources/config/graphql/Location.types.yaml b/src/bundle/Resources/config/graphql/Location.types.yaml index ef20c69..ece9ea4 100644 --- a/src/bundle/Resources/config/graphql/Location.types.yaml +++ b/src/bundle/Resources/config/graphql/Location.types.yaml @@ -27,7 +27,7 @@ Location: parentLocation: type: "Location" description: "The parent location" - resolve: "@=resolver('LocationById', [value.parentLocationId])" + resolve: "@=query('LocationById', [value.parentLocationId])" pathString: type: "String" description: "The path to the Location in the Tree." @@ -39,7 +39,7 @@ Location: description: "Depth location has in the location tree" children: type: "LocationConnection" - resolve: "@=resolver('LocationChildren', [{locationId: value.id}, args])" + resolve: "@=query('LocationChildren', [{locationId: value.id}, args])" argsBuilder: 'Relay::Connection' args: sortBy: { type: '[LocationSortByOptions]', description: 'A sort clause, or array of clauses. Add _desc after a clause to reverse it' } @@ -48,13 +48,13 @@ Location: args: custom: type: "Boolean" - resolve: "@=resolver('LocationUrlAliases', [value, args])" + resolve: "@=query('LocationUrlAliases', [value, args])" contentInfo: type: Content resolve: "@=value.getContentInfo()" content: type: DomainContent - resolve: "@=resolver('DomainContentItem', [{id: value.contentId}, null])" + resolve: "@=query('DomainContentItem', [{id: value.contentId}, null])" LocationSortByOptions: type: enum diff --git a/src/bundle/Resources/config/graphql/Node.types.yaml b/src/bundle/Resources/config/graphql/Node.types.yaml index 453a52e..75e9cbd 100644 --- a/src/bundle/Resources/config/graphql/Node.types.yaml +++ b/src/bundle/Resources/config/graphql/Node.types.yaml @@ -4,4 +4,4 @@ Node: type: relay-node config: - resolveType: '@=resolver("node_type", [value])' + resolveType: '@=query("node_type", [value])' diff --git a/src/bundle/Resources/config/graphql/ObjectStateGroup.types.yaml b/src/bundle/Resources/config/graphql/ObjectStateGroup.types.yaml index 220f52a..d156e11 100644 --- a/src/bundle/Resources/config/graphql/ObjectStateGroup.types.yaml +++ b/src/bundle/Resources/config/graphql/ObjectStateGroup.types.yaml @@ -18,4 +18,4 @@ ObjectStateGroup: states: type: "[ObjectState]" description: "List of ObjectStates under ObjectStateGroup." - resolve: "@=resolver('ObjectStatesByGroup', [value])" + resolve: "@=query('ObjectStatesByGroup', [value])" diff --git a/src/bundle/Resources/config/graphql/Platform.types.yaml b/src/bundle/Resources/config/graphql/Platform.types.yaml index 0f04741..0edd2d5 100644 --- a/src/bundle/Resources/config/graphql/Platform.types.yaml +++ b/src/bundle/Resources/config/graphql/Platform.types.yaml @@ -10,9 +10,9 @@ Platform: builder: Relay::Node builderConfig: nodeInterfaceType: Node - idFetcher: '@=resolver("node", [value])' + idFetcher: '@=query("node", [value])' item: description: "An item, whatever its type" type: Item argsBuilder: "Item" - resolve: "@=resolver('Item', [args])" + resolve: "@=query('Item', [args])" diff --git a/src/bundle/Resources/config/graphql/Repository.types.yaml b/src/bundle/Resources/config/graphql/Repository.types.yaml index 396fa2a..f382cf1 100644 --- a/src/bundle/Resources/config/graphql/Repository.types.yaml +++ b/src/bundle/Resources/config/graphql/Repository.types.yaml @@ -15,7 +15,7 @@ Repository: urlAlias: description: "A location url alias: 'path/to/content-item'" type: "String" - resolve: "@=resolver('Location', [args])" + resolve: "@=query('Location', [args])" contentType: type: "ContentType" args: @@ -25,7 +25,7 @@ Repository: identifier: description: "Resolves using the unique ContentType identifier." type: "String" - resolve: "@=resolver('ContentType', [args])" + resolve: "@=query('ContentType', [args])" contentTypes: type: "[ContentType]" args: @@ -33,7 +33,7 @@ Repository: type: "String" groupIdentifier: type: "String" - resolve: "@=resolver('ContentTypesFromGroup', [args])" + resolve: "@=query('ContentTypesFromGroup', [args])" # # Object States @@ -46,12 +46,12 @@ Repository: id: type: "Int" description: "ID of the Object State Group" - resolve: "@=resolver('ObjectStateGroupById', [args])" + resolve: "@=query('ObjectStateGroupById', [args])" objectStateGroups: type: '[ObjectStateGroup]' description: "Fetches all Object State Groups." - resolve: "@=resolver('ObjectStateGroups')" + resolve: "@=query('ObjectStateGroups')" objectState: type: 'ObjectState' @@ -60,7 +60,7 @@ Repository: id: type: "Int" description: "ID of the Object State" - resolve: "@=resolver('ObjectStateById', [args])" + resolve: "@=query('ObjectStateById', [args])" objectStates: type: '[ObjectState]' @@ -69,4 +69,4 @@ Repository: groupId: type: "Int" description: "ID of the ObjectStateGroup" - resolve: "@=resolver('ObjectStatesByGroupId', [args])" + resolve: "@=query('ObjectStatesByGroupId', [args])" diff --git a/src/bundle/Resources/config/graphql/UrlAlias.types.yaml b/src/bundle/Resources/config/graphql/UrlAlias.types.yaml index 5523b0e..774ec38 100644 --- a/src/bundle/Resources/config/graphql/UrlAlias.types.yaml +++ b/src/bundle/Resources/config/graphql/UrlAlias.types.yaml @@ -21,7 +21,7 @@ UrlAlias: type: "Boolean" forward: type: "Boolean" - resolveType: "@=resolver('UrlAliasType', [value])" + resolveType: "@=query('UrlAliasType', [value])" LocationUrlAlias: type: object @@ -43,7 +43,7 @@ LocationUrlAlias: type: "Boolean" location: type: "Location" - resolve: "@=resolver('LocationById', [value.destination])" + resolve: "@=query('LocationById', [value.destination])" interfaces: [UrlAlias] ResourceUrlAlias: diff --git a/src/bundle/Resources/config/graphql/User.types.yaml b/src/bundle/Resources/config/graphql/User.types.yaml index 824d41c..efb1307 100644 --- a/src/bundle/Resources/config/graphql/User.types.yaml +++ b/src/bundle/Resources/config/graphql/User.types.yaml @@ -22,7 +22,7 @@ User: type: "Int" groups: type: "[UserGroup]" - resolve: "@=resolver('UserGroupsByUserId', [value.id])" + resolve: "@=query('UserGroupsByUserId', [value.id])" thumbnail: type: Thumbnail resolve: "@=query('Thumbnail', value.getThumbnail())" @@ -47,10 +47,10 @@ UserGroup: resolve: "@=value.versionInfo" parentGroup: type: "UserGroup" - resolve: "@=resolver('UserGroupById', [value.parentId])" + resolve: "@=query('UserGroupById', [value.parentId])" subGroups: type: "[UserGroup]" - resolve: "@=resolver('UserGroupSubGroups', [value])" + resolve: "@=query('UserGroupSubGroups', [value])" users: type: "[User]" - resolve: "@=resolver('UsersOfGroup', [value])" + resolve: "@=query('UsersOfGroup', [value])" diff --git a/src/bundle/Resources/config/graphql/Version.types.yaml b/src/bundle/Resources/config/graphql/Version.types.yaml index a4dbf1e..c39ec9a 100644 --- a/src/bundle/Resources/config/graphql/Version.types.yaml +++ b/src/bundle/Resources/config/graphql/Version.types.yaml @@ -24,7 +24,7 @@ Version: type: "Int" creator: type: "User" - resolve: "@=resolver('UserById', [value.creatorId])" + resolve: "@=query('UserById', [value.creatorId])" status: type: "Int" initialLanguageCode: diff --git a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/RelationFieldDefinitionMapper.php b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/RelationFieldDefinitionMapper.php index 4bd7097..395c5b3 100644 --- a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/RelationFieldDefinitionMapper.php +++ b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/RelationFieldDefinitionMapper.php @@ -69,7 +69,7 @@ public function mapToFieldValueResolver(FieldDefinition $fieldDefinition): ?stri $isMultiple = $this->isMultiple($fieldDefinition) ? 'true' : 'false'; - return sprintf('@=resolver("RelationFieldValue", [field, %s])', $isMultiple); + return sprintf('@=query("RelationFieldValue", [field, %s])', $isMultiple); } protected function canMap(FieldDefinition $fieldDefinition) diff --git a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php index 6ba7c08..3eb149f 100644 --- a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php +++ b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php @@ -59,7 +59,7 @@ public function mapToFieldValueResolver(FieldDefinition $fieldDefinition): strin if (preg_match('/value, "(.*field.*)"/i', $resolver) !== 1) { $resolver = str_replace( 'field', - 'resolver("ItemFieldValue", [value, "' . $fieldDefinition->identifier . '", args])', + 'query("ItemFieldValue", [value, "' . $fieldDefinition->identifier . '", args])', $resolver ); } diff --git a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/SelectionFieldDefinitionMapper.php b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/SelectionFieldDefinitionMapper.php index b02aefc..fcf5fc7 100644 --- a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/SelectionFieldDefinitionMapper.php +++ b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/SelectionFieldDefinitionMapper.php @@ -27,7 +27,7 @@ public function mapToFieldValueResolver(FieldDefinition $fieldDefinition): ?stri return parent::mapToFieldValueResolver($fieldDefinition); } - return '@=resolver("SelectionFieldValue", [field, content])'; + return '@=query("SelectionFieldValue", [field, content])'; } protected function getFieldTypeIdentifier(): string diff --git a/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemOfTypeConnectionToGroup.php b/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemOfTypeConnectionToGroup.php index be45d76..c7b7214 100644 --- a/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemOfTypeConnectionToGroup.php +++ b/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemOfTypeConnectionToGroup.php @@ -27,7 +27,7 @@ public function work(Builder $schema, array $args) [ 'description' => isset($descriptions['eng-GB']) ? $descriptions['eng-GB'] : 'No description available', 'resolve' => sprintf( - '@=resolver("ItemsOfTypeAsConnection", ["%s", args])', + '@=query("ItemsOfTypeAsConnection", ["%s", args])', $contentType->identifier ), 'argsBuilder' => 'Relay::Connection', diff --git a/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemToGroup.php b/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemToGroup.php index 5226701..cf9cd96 100644 --- a/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemToGroup.php +++ b/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemToGroup.php @@ -26,7 +26,7 @@ public function work(Builder $schema, array $args) $this->typeName($args), [ 'description' => isset($descriptions['eng-GB']) ? $descriptions['eng-GB'] : 'No description available', - 'resolve' => sprintf('@=resolver("ItemOfType", [args, "%s"])', $contentType->identifier), + 'resolve' => sprintf('@=query("ItemOfType", [args, "%s"])', $contentType->identifier), ] )); diff --git a/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemTypeToItemGroupTypes.php b/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemTypeToItemGroupTypes.php index cc4747f..60d0ff3 100644 --- a/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemTypeToItemGroupTypes.php +++ b/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemTypeToItemGroupTypes.php @@ -19,7 +19,7 @@ class AddItemTypeToItemGroupTypes extends BaseWorker implements Worker public function work(Builder $schema, array $args) { $resolve = sprintf( - '@=resolver("ContentType", [{"identifier": "%s"}])', + '@=query("ContentType", [{"identifier": "%s"}])', $args['ContentType']->identifier ); diff --git a/src/lib/Schema/Domain/Content/Worker/ContentTypeGroup/AddDomainGroupToDomain.php b/src/lib/Schema/Domain/Content/Worker/ContentTypeGroup/AddDomainGroupToDomain.php index 0dad342..de459fb 100644 --- a/src/lib/Schema/Domain/Content/Worker/ContentTypeGroup/AddDomainGroupToDomain.php +++ b/src/lib/Schema/Domain/Content/Worker/ContentTypeGroup/AddDomainGroupToDomain.php @@ -35,7 +35,7 @@ public function work(Builder $schema, array $args) [ 'description' => $contentTypeGroup->getDescription('eng-GB'), 'resolve' => sprintf( - '@=resolver("ContentTypeGroupByIdentifier", ["%s"])', + '@=query("ContentTypeGroupByIdentifier", ["%s"])', $contentTypeGroup->identifier ), ] From 4c2771ca6496248a948c5d7da52fbeb212caf5cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Mon, 30 Dec 2024 12:42:15 +0100 Subject: [PATCH 06/10] Fixed code style --- .../DependencyInjection/GraphQL/YamlSchemaProvider.php | 2 -- src/lib/Relay/PageAwareConnection.php | 8 ++++---- src/lib/Resolver/ItemResolver.php | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/bundle/DependencyInjection/GraphQL/YamlSchemaProvider.php b/src/bundle/DependencyInjection/GraphQL/YamlSchemaProvider.php index e55875f..64686e7 100644 --- a/src/bundle/DependencyInjection/GraphQL/YamlSchemaProvider.php +++ b/src/bundle/DependencyInjection/GraphQL/YamlSchemaProvider.php @@ -7,8 +7,6 @@ namespace Ibexa\Bundle\GraphQL\DependencyInjection\GraphQL; -use Ibexa\GraphQL\Resolver\Map\UploadMap; - /** * Provides schema definitions. */ diff --git a/src/lib/Relay/PageAwareConnection.php b/src/lib/Relay/PageAwareConnection.php index 043ec7d..db34446 100644 --- a/src/lib/Relay/PageAwareConnection.php +++ b/src/lib/Relay/PageAwareConnection.php @@ -12,8 +12,6 @@ use Overblog\GraphQLBundle\Definition\Argument; use Overblog\GraphQLBundle\Relay\Connection\ConnectionBuilder; use Overblog\GraphQLBundle\Relay\Connection\ConnectionInterface; -use Overblog\GraphQLBundle\Relay\Connection\EdgeInterface; -use Overblog\GraphQLBundle\Relay\Connection\Output\Connection; use Overblog\GraphQLBundle\Relay\Connection\PageInfoInterface; /** @@ -50,7 +48,7 @@ public static function fromConnection(ConnectionInterface|Promise $connection, A { $connection = self::resolvePromise( $connection, - fn($resolved) => $resolved instanceof ConnectionInterface, + static fn ($resolved) => $resolved instanceof ConnectionInterface, 'Resolved result is not a ConnectionInterface' ); @@ -58,7 +56,7 @@ public static function fromConnection(ConnectionInterface|Promise $connection, A $totalCount = self::resolvePromise( $connection->getTotalCount(), - fn($resolved) => is_int($resolved) || is_null($resolved), + static fn ($resolved) => is_int($resolved) || null === $resolved, 'Resolved result is not an int or null' ); @@ -86,8 +84,10 @@ private static function resolvePromise(mixed $value, callable $validator, string if (!$validator($resolvedValue)) { throw new \UnexpectedValueException($errorMessage); } + return $resolvedValue; } + return $value; } } diff --git a/src/lib/Resolver/ItemResolver.php b/src/lib/Resolver/ItemResolver.php index 679c5d5..b76137e 100644 --- a/src/lib/Resolver/ItemResolver.php +++ b/src/lib/Resolver/ItemResolver.php @@ -13,7 +13,6 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Query; use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType; use Ibexa\GraphQL\DataLoader\ContentLoader; -use Ibexa\GraphQL\DataLoader\ContentTypeLoader; use Ibexa\GraphQL\DataLoader\LocationLoader; use Ibexa\GraphQL\InputMapper\QueryMapper; use Ibexa\GraphQL\ItemFactory; From 05215d99d2f00af61be9beb8bf855707dce2ee7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Mon, 30 Dec 2024 13:11:57 +0100 Subject: [PATCH 07/10] fixup! Replaced deprecated resolver expression function usage --- .../Resources/config/services/resolvers.yaml | 128 +++++++++--------- src/lib/Resolver/ContentResolver.php | 3 +- src/lib/Resolver/ContentThumbnailResolver.php | 3 +- src/lib/Resolver/DomainContentResolver.php | 3 +- src/lib/Resolver/ItemResolver.php | 3 +- src/lib/Resolver/LocationResolver.php | 3 +- src/lib/Resolver/RelationFieldResolver.php | 3 +- src/lib/Resolver/ThumbnailResolver.php | 3 +- 8 files changed, 78 insertions(+), 71 deletions(-) diff --git a/src/bundle/Resources/config/services/resolvers.yaml b/src/bundle/Resources/config/services/resolvers.yaml index dc0f948..0e791e9 100644 --- a/src/bundle/Resources/config/services/resolvers.yaml +++ b/src/bundle/Resources/config/services/resolvers.yaml @@ -6,59 +6,59 @@ services: Ibexa\GraphQL\Resolver\LocationResolver: tags: - - { name: overblog_graphql.resolver, alias: "Location", method: "resolveLocation" } - - { name: overblog_graphql.resolver, alias: "LocationById", method: "resolveLocationById" } - - { name: overblog_graphql.resolver, alias: "LocationChildren", method: "resolveLocationChildren" } - - { name: overblog_graphql.resolver, alias: "LocationsByContentId", method: "resolveLocationsByContentId" } + - { name: overblog_graphql.query, alias: "Location", method: "resolveLocation" } + - { name: overblog_graphql.query, alias: "LocationById", method: "resolveLocationById" } + - { name: overblog_graphql.query, alias: "LocationChildren", method: "resolveLocationChildren" } + - { name: overblog_graphql.query, alias: "LocationsByContentId", method: "resolveLocationsByContentId" } arguments: $locationService: '@ibexa.siteaccessaware.service.location' $contentService: '@ibexa.siteaccessaware.service.content' Ibexa\GraphQL\Resolver\ContentResolver: tags: - - { name: overblog_graphql.resolver, alias: "Content", method: "resolveContent" } - - { name: overblog_graphql.resolver, alias: "ContentById", method: "resolveContentById" } - - { name: overblog_graphql.resolver, alias: "ContentByIdList", method: "resolveContentByIdList" } - - { name: overblog_graphql.resolver, alias: "ContentVersions", method: "resolveContentVersions" } - - { name: overblog_graphql.resolver, alias: "ContentByType", method: "findContentByType" } - - { name: overblog_graphql.resolver, alias: "ContentRelations", method: "findContentRelations" } - - { name: overblog_graphql.resolver, alias: "ContentReverseRelations", method: "findContentReverseRelations" } - - { name: overblog_graphql.resolver, alias: "CurrentVersion", method: "resolveCurrentVersion" } + - { name: overblog_graphql.query, alias: "Content", method: "resolveContent" } + - { name: overblog_graphql.query, alias: "ContentById", method: "resolveContentById" } + - { name: overblog_graphql.query, alias: "ContentByIdList", method: "resolveContentByIdList" } + - { name: overblog_graphql.query, alias: "ContentVersions", method: "resolveContentVersions" } + - { name: overblog_graphql.query, alias: "ContentByType", method: "findContentByType" } + - { name: overblog_graphql.query, alias: "ContentRelations", method: "findContentRelations" } + - { name: overblog_graphql.query, alias: "ContentReverseRelations", method: "findContentReverseRelations" } + - { name: overblog_graphql.query, alias: "CurrentVersion", method: "resolveCurrentVersion" } arguments: $contentService: '@ibexa.siteaccessaware.service.content' $searchService: '@ibexa.siteaccessaware.service.search' Ibexa\GraphQL\Resolver\DomainContentResolver: tags: - - { name: overblog_graphql.resolver, alias: "DomainContentItemsByTypeIdentifier", method: "resolveDomainContentItems" } - - { name: overblog_graphql.resolver, alias: "DomainContentType", method: "resolveDomainContentType" } - - { name: overblog_graphql.resolver, alias: "DomainContentItem", method: "resolveDomainContentItem" } - - { name: overblog_graphql.resolver, alias: "DomainRelationFieldValue", method: "resolveDomainRelationFieldValue" } - - { name: overblog_graphql.resolver, alias: "MainUrlAlias", method: "resolveMainUrlAlias" } + - { name: overblog_graphql.query, alias: "DomainContentItemsByTypeIdentifier", method: "resolveDomainContentItems" } + - { name: overblog_graphql.query, alias: "DomainContentType", method: "resolveDomainContentType" } + - { name: overblog_graphql.query, alias: "DomainContentItem", method: "resolveDomainContentItem" } + - { name: overblog_graphql.query, alias: "DomainRelationFieldValue", method: "resolveDomainRelationFieldValue" } + - { name: overblog_graphql.query, alias: "MainUrlAlias", method: "resolveMainUrlAlias" } arguments: $repository: '@ibexa.siteaccessaware.repository' Ibexa\GraphQL\Resolver\ItemResolver: tags: - - { name: overblog_graphql.resolver, alias: "Item", method: "resolveItem" } - - { name: overblog_graphql.resolver, alias: "ItemOfType", method: "resolveItemOfType" } - - { name: overblog_graphql.resolver, alias: "ItemFieldValue", method: "resolveItemFieldValue" } - - { name: overblog_graphql.resolver, alias: "ItemType", method: "resolveItemType" } - - { name: overblog_graphql.resolver, alias: "ItemsOfTypeAsConnection", method: "resolveItemsOfTypeAsConnection" } + - { name: overblog_graphql.query, alias: "Item", method: "resolveItem" } + - { name: overblog_graphql.query, alias: "ItemOfType", method: "resolveItemOfType" } + - { name: overblog_graphql.query, alias: "ItemFieldValue", method: "resolveItemFieldValue" } + - { name: overblog_graphql.query, alias: "ItemType", method: "resolveItemType" } + - { name: overblog_graphql.query, alias: "ItemsOfTypeAsConnection", method: "resolveItemsOfTypeAsConnection" } Ibexa\GraphQL\Resolver\RelationFieldResolver: tags: - - { name: overblog_graphql.resolver, alias: "RelationFieldValue", method: "resolveRelationFieldValue" } + - { name: overblog_graphql.query, alias: "RelationFieldValue", method: "resolveRelationFieldValue" } Ibexa\GraphQL\Resolver\ContentThumbnailResolver: tags: - - { name: overblog_graphql.resolver, alias: "ContentThumbnail", method: "resolveContentThumbnail" } + - { name: overblog_graphql.query, alias: "ContentThumbnail", method: "resolveContentThumbnail" } arguments: $thumbnailStrategy: '@Ibexa\Core\Repository\Strategy\ContentThumbnail\ThumbnailChainStrategy' Ibexa\GraphQL\Resolver\ThumbnailResolver: tags: - - { name: overblog_graphql.resolver, alias: "Thumbnail", method: "resolveThumbnail" } + - { name: overblog_graphql.query, alias: "Thumbnail", method: "resolveThumbnail" } Ibexa\GraphQL\Mutation\AuthenticationMutation: tags: @@ -72,41 +72,41 @@ services: Ibexa\GraphQL\Resolver\UserResolver: tags: - - { name: overblog_graphql.resolver, alias: "User", method: "resolveUser" } - - { name: overblog_graphql.resolver, alias: "UserGroups", method: "resolveUserGroups" } - - { name: overblog_graphql.resolver, alias: "UserById", method: "resolveUserById" } - - { name: overblog_graphql.resolver, alias: "UserGroupsByUserId", method: "resolveUserGroupsByUserId" } - - { name: overblog_graphql.resolver, alias: "UserGroupById", method: "resolveUserGroupById" } - - { name: overblog_graphql.resolver, alias: "UserGroupSubGroups", method: "resolveUserGroupSubGroups" } - - { name: overblog_graphql.resolver, alias: "UsersOfGroup", method: "resolveUsersOfGroup" } + - { name: overblog_graphql.query, alias: "User", method: "resolveUser" } + - { name: overblog_graphql.query, alias: "UserGroups", method: "resolveUserGroups" } + - { name: overblog_graphql.query, alias: "UserById", method: "resolveUserById" } + - { name: overblog_graphql.query, alias: "UserGroupsByUserId", method: "resolveUserGroupsByUserId" } + - { name: overblog_graphql.query, alias: "UserGroupById", method: "resolveUserGroupById" } + - { name: overblog_graphql.query, alias: "UserGroupSubGroups", method: "resolveUserGroupSubGroups" } + - { name: overblog_graphql.query, alias: "UsersOfGroup", method: "resolveUsersOfGroup" } Ibexa\GraphQL\Resolver\ContentTypeResolver: tags: - - { name: overblog_graphql.resolver, alias: "ContentTypeById", method: "resolveContentTypeById" } - - { name: overblog_graphql.resolver, alias: "ContentType", method: "resolveContentType" } - - { name: overblog_graphql.resolver, alias: "ContentTypesFromGroup", method: "resolveContentTypesFromGroup" } - - { name: overblog_graphql.resolver, alias: "ContentTypeGroupByIdentifier", method: "resolveContentTypeGroupByIdentifier" } + - { name: overblog_graphql.query, alias: "ContentTypeById", method: "resolveContentTypeById" } + - { name: overblog_graphql.query, alias: "ContentType", method: "resolveContentType" } + - { name: overblog_graphql.query, alias: "ContentTypesFromGroup", method: "resolveContentTypesFromGroup" } + - { name: overblog_graphql.query, alias: "ContentTypeGroupByIdentifier", method: "resolveContentTypeGroupByIdentifier" } arguments: $contentTypeService: '@ibexa.siteaccessaware.service.content_type' Ibexa\GraphQL\Resolver\FieldDefinitionResolver: tags: - - { name: overblog_graphql.resolver, alias: "FieldDefinitionName", method: "resolveFieldDefinitionName" } - - { name: overblog_graphql.resolver, alias: "FieldDefinitionDescription", method: "resolveFieldDefinitionDescription" } - - { name: overblog_graphql.resolver, alias: "SelectionFieldDefinitionOptions", method: "resolveSelectionFieldDefinitionOptions" } + - { name: overblog_graphql.query, alias: "FieldDefinitionName", method: "resolveFieldDefinitionName" } + - { name: overblog_graphql.query, alias: "FieldDefinitionDescription", method: "resolveFieldDefinitionDescription" } + - { name: overblog_graphql.query, alias: "SelectionFieldDefinitionOptions", method: "resolveSelectionFieldDefinitionOptions" } Ibexa\GraphQL\Resolver\SectionResolver: tags: - - { name: overblog_graphql.resolver, alias: "SectionById", method: "resolveSectionById" } + - { name: overblog_graphql.query, alias: "SectionById", method: "resolveSectionById" } arguments: $sectionService: '@ibexa.siteaccessaware.service.section' Ibexa\GraphQL\Resolver\UrlAliasResolver: tags: - - { name: overblog_graphql.resolver, alias: "UrlAliasType", method: "resolveUrlAliasType" } - - { name: overblog_graphql.resolver, alias: "LocationUrlAliases", method: "resolveLocationUrlAliases" } - - { name: overblog_graphql.resolver, alias: "LocationUrlAlias", method: "resolveLocationUrlAlias" } - - { name: overblog_graphql.resolver, alias: "ItemUrlAlias", method: "resolveItemUrlAlias" } + - { name: overblog_graphql.query, alias: "UrlAliasType", method: "resolveUrlAliasType" } + - { name: overblog_graphql.query, alias: "LocationUrlAliases", method: "resolveLocationUrlAliases" } + - { name: overblog_graphql.query, alias: "LocationUrlAlias", method: "resolveLocationUrlAlias" } + - { name: overblog_graphql.query, alias: "ItemUrlAlias", method: "resolveItemUrlAlias" } arguments: $urlAliasService: '@ibexa.siteaccessaware.service.url_alias' $urlGenerator: '@Ibexa\Core\MVC\Symfony\Routing\Generator\UrlAliasGenerator' @@ -114,17 +114,17 @@ services: Ibexa\GraphQL\Resolver\SearchResolver: tags: - - { name: overblog_graphql.resolver, alias: "SearchContent", method: "searchContent" } - - { name: overblog_graphql.resolver, alias: "SearchContentOfTypeAsConnection", method: "searchContentOfTypeAsConnection" } + - { name: overblog_graphql.query, alias: "SearchContent", method: "searchContent" } + - { name: overblog_graphql.query, alias: "SearchContentOfTypeAsConnection", method: "searchContentOfTypeAsConnection" } Ibexa\GraphQL\Resolver\RichTextResolver: arguments: - '@ibexa.richtext.converter.output.xhtml5' - '@Ibexa\FieldTypeRichText\RichText\Converter\Html5Edit' tags: - - { name: overblog_graphql.resolver, alias: "RichTextXmlToHtml5", method: "xmlToHtml5" } - - { name: overblog_graphql.resolver, alias: "RichTextXmlToHtml5Edit", method: "xmlToHtml5Edit" } - - { name: overblog_graphql.resolver, alias: "RichTextXmlToPlainText", method: "xmlToplainText" } + - { name: overblog_graphql.query, alias: "RichTextXmlToHtml5", method: "xmlToHtml5" } + - { name: overblog_graphql.query, alias: "RichTextXmlToHtml5Edit", method: "xmlToHtml5Edit" } + - { name: overblog_graphql.query, alias: "RichTextXmlToPlainText", method: "xmlToplainText" } Ibexa\GraphQL\Resolver\ImageFieldResolver: arguments: @@ -132,31 +132,31 @@ services: $variationHandler: '@ibexa.field_type.ezimage.variation_service' $contentService: '@ibexa.siteaccessaware.service.content' tags: - - { name: overblog_graphql.resolver, alias: "ImageVariations", method: "resolveImageVariations" } - - { name: overblog_graphql.resolver, alias: "ImageVariation", method: "resolveImageVariation" } + - { name: overblog_graphql.query, alias: "ImageVariations", method: "resolveImageVariations" } + - { name: overblog_graphql.query, alias: "ImageVariation", method: "resolveImageVariation" } Ibexa\GraphQL\Resolver\DateResolver: tags: - - { name: overblog_graphql.resolver, alias: "DateTimeFormat", method: "resolveDateToFormat"} + - { name: overblog_graphql.query, alias: "DateTimeFormat", method: "resolveDateToFormat"} Ibexa\GraphQL\Resolver\ImageAssetFieldResolver: arguments: $strategies: !tagged_iterator ibexa.field_type.image_asset.mapper.strategy tags: - - { name: overblog_graphql.resolver, alias: "DomainImageAssetFieldValue", method: "resolveDomainImageAssetFieldValue"} + - { name: overblog_graphql.query, alias: "DomainImageAssetFieldValue", method: "resolveDomainImageAssetFieldValue"} Ibexa\GraphQL\Resolver\SelectionFieldResolver: tags: - - { name: overblog_graphql.resolver, alias: "SelectionFieldValue", method: "resolveSelectionFieldValue"} + - { name: overblog_graphql.query, alias: "SelectionFieldValue", method: "resolveSelectionFieldValue"} Ibexa\GraphQL\Relay\NodeResolver: tags: - - { name: overblog_graphql.resolver, alias: "node", method: "resolveNode" } - - { name: overblog_graphql.resolver, alias: "node_type", method: "resolveType" } + - { name: overblog_graphql.query, alias: "node", method: "resolveNode" } + - { name: overblog_graphql.query, alias: "node_type", method: "resolveType" } Ibexa\GraphQL\Relay\SearchResolver: tags: - - {name: overblog_graphql.resolver, alias: "SearchContentConnection", method: "searchContent"} + - {name: overblog_graphql.query, alias: "SearchContentConnection", method: "searchContent"} # # Object States @@ -166,17 +166,17 @@ services: arguments: $objectStateService: '@ibexa.siteaccessaware.service.object_state' tags: - - {name: overblog_graphql.resolver, alias: "ObjectStateGroupById", method: "resolveObjectStateGroupById"} - - {name: overblog_graphql.resolver, alias: "ObjectStateGroups", method: "resolveObjectStateGroups"} + - {name: overblog_graphql.query, alias: "ObjectStateGroupById", method: "resolveObjectStateGroupById"} + - {name: overblog_graphql.query, alias: "ObjectStateGroups", method: "resolveObjectStateGroups"} Ibexa\GraphQL\Resolver\ObjectStateResolver: arguments: $objectStateService: '@ibexa.siteaccessaware.service.object_state' tags: - - {name: overblog_graphql.resolver, alias: "ObjectStateById", method: "resolveObjectStateById"} - - {name: overblog_graphql.resolver, alias: "ObjectStateByContentInfo", method: "resolveObjectStateByContentInfo"} - - {name: overblog_graphql.resolver, alias: "ObjectStatesByGroup", method: "resolveObjectStatesByGroup"} - - {name: overblog_graphql.resolver, alias: "ObjectStatesByGroupId", method: "resolveObjectStatesByGroupId"} + - {name: overblog_graphql.query, alias: "ObjectStateById", method: "resolveObjectStateById"} + - {name: overblog_graphql.query, alias: "ObjectStateByContentInfo", method: "resolveObjectStateByContentInfo"} + - {name: overblog_graphql.query, alias: "ObjectStatesByGroup", method: "resolveObjectStatesByGroup"} + - {name: overblog_graphql.query, alias: "ObjectStatesByGroupId", method: "resolveObjectStatesByGroupId"} # # Content mutations @@ -189,5 +189,5 @@ services: Ibexa\GraphQL\Resolver\Map\UploadMap: tags: - - name: overblog_graphql.resolver_map + - name: overblog_graphql.query_map schema: default diff --git a/src/lib/Resolver/ContentResolver.php b/src/lib/Resolver/ContentResolver.php index 733b1aa..30f9b6b 100644 --- a/src/lib/Resolver/ContentResolver.php +++ b/src/lib/Resolver/ContentResolver.php @@ -15,11 +15,12 @@ use Ibexa\Contracts\Core\Repository\Values\Content\RelationList\RelationListItemInterface; use Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchHit; use Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo; +use Overblog\GraphQLBundle\Definition\Resolver\QueryInterface; /** * @internal */ -class ContentResolver +class ContentResolver implements QueryInterface { /** * @var \Ibexa\Contracts\Core\Repository\ContentService diff --git a/src/lib/Resolver/ContentThumbnailResolver.php b/src/lib/Resolver/ContentThumbnailResolver.php index f015374..fc75e59 100644 --- a/src/lib/Resolver/ContentThumbnailResolver.php +++ b/src/lib/Resolver/ContentThumbnailResolver.php @@ -9,8 +9,9 @@ use Ibexa\Contracts\Core\Repository\Strategy\ContentThumbnail\ThumbnailStrategy; use Ibexa\Contracts\Core\Repository\Values\Content\Content; +use Overblog\GraphQLBundle\Definition\Resolver\QueryInterface; -final class ContentThumbnailResolver +final class ContentThumbnailResolver implements QueryInterface { /** @var \Ibexa\Contracts\Core\Repository\Strategy\ContentThumbnail\ThumbnailStrategy */ private $thumbnailStrategy; diff --git a/src/lib/Resolver/DomainContentResolver.php b/src/lib/Resolver/DomainContentResolver.php index 50dc9a0..12de119 100644 --- a/src/lib/Resolver/DomainContentResolver.php +++ b/src/lib/Resolver/DomainContentResolver.php @@ -18,13 +18,14 @@ use Ibexa\GraphQL\InputMapper\QueryMapper; use Ibexa\GraphQL\Value\Field; use Overblog\GraphQLBundle\Definition\Argument; +use Overblog\GraphQLBundle\Definition\Resolver\QueryInterface; use Overblog\GraphQLBundle\Resolver\TypeResolver; use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter; /** * @internal */ -class DomainContentResolver +class DomainContentResolver implements QueryInterface { /** * @var \Overblog\GraphQLBundle\Resolver\TypeResolver diff --git a/src/lib/Resolver/ItemResolver.php b/src/lib/Resolver/ItemResolver.php index b76137e..49905cd 100644 --- a/src/lib/Resolver/ItemResolver.php +++ b/src/lib/Resolver/ItemResolver.php @@ -18,6 +18,7 @@ use Ibexa\GraphQL\ItemFactory; use Ibexa\GraphQL\Value\Field; use Ibexa\GraphQL\Value\Item; +use Overblog\GraphQLBundle\Definition\Resolver\QueryInterface; use Overblog\GraphQLBundle\Relay\Connection\Output\Connection; use Overblog\GraphQLBundle\Relay\Connection\Paginator; use Overblog\GraphQLBundle\Resolver\TypeResolver; @@ -26,7 +27,7 @@ /** * @internal */ -final class ItemResolver +final class ItemResolver implements QueryInterface { /** @var \Overblog\GraphQLBundle\Resolver\TypeResolver */ private $typeResolver; diff --git a/src/lib/Resolver/LocationResolver.php b/src/lib/Resolver/LocationResolver.php index 5e41e7e..2acbbde 100644 --- a/src/lib/Resolver/LocationResolver.php +++ b/src/lib/Resolver/LocationResolver.php @@ -17,12 +17,13 @@ use Ibexa\GraphQL\InputMapper\SearchQuerySortByMapper; use Ibexa\GraphQL\Relay\PageAwareConnection; use Overblog\GraphQLBundle\Definition\Argument; +use Overblog\GraphQLBundle\Definition\Resolver\QueryInterface; use Overblog\GraphQLBundle\Relay\Connection\Paginator; /** * @internal */ -class LocationResolver +class LocationResolver implements QueryInterface { public const DEFAULT_LIMIT = 10; diff --git a/src/lib/Resolver/RelationFieldResolver.php b/src/lib/Resolver/RelationFieldResolver.php index b422d15..e534a36 100644 --- a/src/lib/Resolver/RelationFieldResolver.php +++ b/src/lib/Resolver/RelationFieldResolver.php @@ -13,8 +13,9 @@ use Ibexa\GraphQL\DataLoader\ContentLoader; use Ibexa\GraphQL\ItemFactory; use Ibexa\GraphQL\Value\Field; +use Overblog\GraphQLBundle\Definition\Resolver\QueryInterface; -final class RelationFieldResolver +final class RelationFieldResolver implements QueryInterface { /** @var \Ibexa\GraphQL\DataLoader\ContentLoader */ private $contentLoader; diff --git a/src/lib/Resolver/ThumbnailResolver.php b/src/lib/Resolver/ThumbnailResolver.php index 3a00d8e..4d7b0b3 100644 --- a/src/lib/Resolver/ThumbnailResolver.php +++ b/src/lib/Resolver/ThumbnailResolver.php @@ -9,8 +9,9 @@ namespace Ibexa\GraphQL\Resolver; use Ibexa\Contracts\Core\Repository\Values\Content\Thumbnail; +use Overblog\GraphQLBundle\Definition\Resolver\QueryInterface; -final class ThumbnailResolver +final class ThumbnailResolver implements QueryInterface { /** * @return array|null array with the thumbnail info, or null if no thumbnail could be obtained for that image From d8fbefd026d230c532a7af8be4710124eb67e0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Mon, 30 Dec 2024 14:03:16 +0100 Subject: [PATCH 08/10] fixup! Replaced deprecated resolver expression function usage --- .../Resources/config/default_settings.yaml | 2 +- .../Resources/config/graphql/Content.types.yaml | 16 ++++++++-------- .../config/graphql/ContentType.types.yaml | 8 ++++---- .../config/graphql/DomainContent.types.yaml | 10 +++++----- .../Resources/config/graphql/Field.types.yaml | 12 ++++++------ .../config/graphql/FieldDefinition.types.yaml | 2 +- .../Resources/config/graphql/Item.types.yaml | 8 ++++---- .../Resources/config/graphql/Location.types.yaml | 8 ++++---- .../Resources/config/graphql/Node.types.yaml | 2 +- .../config/graphql/ObjectStateGroup.types.yaml | 2 +- .../Resources/config/graphql/Platform.types.yaml | 4 ++-- .../config/graphql/Repository.types.yaml | 12 ++++++------ .../Resources/config/graphql/UrlAlias.types.yaml | 4 ++-- .../Resources/config/graphql/User.types.yaml | 8 ++++---- .../Resources/config/graphql/Version.types.yaml | 2 +- .../RelationFieldDefinitionMapper.php | 2 +- .../Mapper/FieldDefinition/ResolverVariables.php | 2 +- .../SelectionFieldDefinitionMapper.php | 2 +- .../AddItemOfTypeConnectionToGroup.php | 2 +- .../Worker/ContentType/AddItemToGroup.php | 2 +- .../ContentType/AddItemTypeToItemGroupTypes.php | 2 +- .../ContentTypeGroup/AddDomainGroupToDomain.php | 2 +- 22 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/bundle/Resources/config/default_settings.yaml b/src/bundle/Resources/config/default_settings.yaml index d3cc8a4..5f1c11c 100644 --- a/src/bundle/Resources/config/default_settings.yaml +++ b/src/bundle/Resources/config/default_settings.yaml @@ -46,7 +46,7 @@ parameters: input_type: ImageFieldInput ezimageasset: value_type: ImageFieldValue - value_resolver: 'query("DomainImageAssetFieldValue", [field])' + value_resolver: 'query("DomainImageAssetFieldValue", field)' ezinteger: definition_type: IntegerFieldDefinition value_type: Int diff --git a/src/bundle/Resources/config/graphql/Content.types.yaml b/src/bundle/Resources/config/graphql/Content.types.yaml index 857a3b5..1057dcb 100644 --- a/src/bundle/Resources/config/graphql/Content.types.yaml +++ b/src/bundle/Resources/config/graphql/Content.types.yaml @@ -12,25 +12,25 @@ Content: contentType: type: "ContentType" description: "The content type of the Content item." - resolve: "@=query('ContentTypeById', [value.contentTypeId])" + resolve: "@=query('ContentTypeById', value.contentTypeId)" name: type: "String" description: "The computed name (via name schema) in the main language of the Content item." section: type: "Section" description: "The section to which the Content object is assigned." - resolve: "@=query('SectionById', [value.sectionId])" + resolve: "@=query('SectionById', value.sectionId)" currentVersionNo: type: "Int" description: "Version number of the published version, or 1 for a newly created draft." currentVersion: type: "Version" description: "The currently published version" - resolve: "@=query('CurrentVersion', [value])" + resolve: "@=query('CurrentVersion', value)" versions: type: "[Version]" description: "All content versions." - resolve: "@=query('ContentVersions', [value.id])" + resolve: "@=query('ContentVersions', value.id)" published: type: "Boolean" description: "If the Content item has a published version." @@ -40,7 +40,7 @@ Content: owner: type: "User" description: "The owner user of the Content object" - resolve: "@=query('UserById', [value.ownerId])" + resolve: "@=query('UserById', value.ownerId)" modificationDate: type: DateTime description: "Date the Content item was last modified on." @@ -62,15 +62,15 @@ Content: mainLocation: type: "Location" description: "Content item's main location." - resolve: "@=query('LocationById', [value.mainLocationId])" + resolve: "@=query('LocationById', value.mainLocationId)" locations: type: "[Location]" description: "All the locations of the Content item" - resolve: "@=query('LocationsByContentId', [value.id])" + resolve: "@=query('LocationsByContentId', value.id)" relations: type: "[ContentRelation]" description: "Relations from this Content" - resolve: "@=query('ContentRelations', [value])" + resolve: "@=query('ContentRelations', value)" reverseRelations: type: "[ContentRelation]" description: "Relations to this Content" diff --git a/src/bundle/Resources/config/graphql/ContentType.types.yaml b/src/bundle/Resources/config/graphql/ContentType.types.yaml index 022ab80..db4dcc2 100644 --- a/src/bundle/Resources/config/graphql/ContentType.types.yaml +++ b/src/bundle/Resources/config/graphql/ContentType.types.yaml @@ -47,14 +47,14 @@ ContentType: creator: type: "User" description: "The user who created this content type." - resolve: "@=query('UserById', [value.creatorId])" + resolve: "@=query('UserById', value.creatorId)" modifierId: type: "Int" description: "The user id of the user which has last modified this content type" modifier: type: "User" description: "The user which has last modified this content type" - resolve: "@=query('UserById', [value.modifierId])" + resolve: "@=query('UserById', value.modifierId)" remoteId: type: "String" description: "A global unique id of the content type." @@ -99,12 +99,12 @@ ContentTypeGroup: type: "Int" creator: type: "User" - resolve: "@=query('UserById', [value.creatorId])" + resolve: "@=query('UserById', value.creatorId)" modifierId: type: "Int" modifier: type: "User" - resolve: "@=query('UserById', [value.modifierId])" + resolve: "@=query('UserById', value.modifierId)" contentTypes: type: "[ContentType]" resolve: "@=query('ContentTypesFromGroup', {'groupId': value.id})" diff --git a/src/bundle/Resources/config/graphql/DomainContent.types.yaml b/src/bundle/Resources/config/graphql/DomainContent.types.yaml index ea89fc7..c3eab4b 100644 --- a/src/bundle/Resources/config/graphql/DomainContent.types.yaml +++ b/src/bundle/Resources/config/graphql/DomainContent.types.yaml @@ -29,7 +29,7 @@ DomainContent: type: String _thumbnail: type: Thumbnail - resolveType: "@=query('DomainContentType', [value])" + resolveType: "@=query('DomainContentType', value)" AbstractDomainContent: type: "object" @@ -44,7 +44,7 @@ AbstractDomainContent: _type: description: "The item's content type" type: ContentType - resolve: '@=query("ContentTypeById", [value.contentInfo.contentTypeId])' + resolve: '@=query("ContentTypeById", value.contentInfo.contentTypeId)' _content: description: 'Underlying content info item' type: Content @@ -57,11 +57,11 @@ AbstractDomainContent: _location: description: 'Main location' type: Location - resolve: '@=query("LocationById", [value.contentInfo.mainLocationId])' + resolve: '@=query("LocationById", value.contentInfo.mainLocationId)' _allLocations: description: 'All the locations' type: '[Location]' - resolve: '@=query("LocationsByContentId", [value.contentInfo.id])' + resolve: '@=query("LocationsByContentId", value.contentInfo.id)' _name: description: "The content item's name, in the prioritized language(s), based on the object name pattern" type: String @@ -69,7 +69,7 @@ AbstractDomainContent: _url: description: "The content item's url alias, based on the main location." type: String - resolve: "@=query('MainUrlAlias', [value])" + resolve: "@=query('MainUrlAlias', value)" _thumbnail: type: Thumbnail resolve: "@=query('Thumbnail', value.getThumbnail())" diff --git a/src/bundle/Resources/config/graphql/Field.types.yaml b/src/bundle/Resources/config/graphql/Field.types.yaml index 08a8d08..17440b9 100644 --- a/src/bundle/Resources/config/graphql/Field.types.yaml +++ b/src/bundle/Resources/config/graphql/Field.types.yaml @@ -45,14 +45,14 @@ ImageFieldValue: identifier: type: "[ImageVariationIdentifier]!" description: "One or more variation identifiers." - resolve: "@=query('ImageVariations', [value.value, args])" + resolve: "@=query('ImageVariations', value.value, args)" variation: type: ImageVariation args: identifier: type: ImageVariationIdentifier! description: "A variation identifier." - resolve: "@=query('ImageVariation', [value.value, args])" + resolve: "@=query('ImageVariation', value.value, args)" ImageAdditionalData: type: object @@ -139,7 +139,7 @@ DateFieldValue: formatted: type: "String" description: "Formatted date" - resolve: "@=query('DateTimeFormat', [args['format'], value.value])" + resolve: "@=query('DateTimeFormat', args['format'], value.value)" args: format: type: String @@ -248,15 +248,15 @@ RichTextFieldValue: plaintext: type: "String" description: "Plain text representation of the value, without tags. Warning: the text representation may not be perfect." - resolve: "@=query('RichTextXmlToPlainText', [value.xml])" + resolve: "@=query('RichTextXmlToPlainText', value.xml)" html5: type: "String" description: "HTML5 representation." - resolve: "@=query('RichTextXmlToHtml5', [value.xml])" + resolve: "@=query('RichTextXmlToHtml5', value.xml)" html5_edit: type: "String" description: "Editable HTML5 representation." - resolve: "@=query('RichTextXmlToHtml5Edit', [value.xml])" + resolve: "@=query('RichTextXmlToHtml5Edit', value.xml)" SelectionFieldValue: type: object diff --git a/src/bundle/Resources/config/graphql/FieldDefinition.types.yaml b/src/bundle/Resources/config/graphql/FieldDefinition.types.yaml index 3aeb8bf..5af2dd2 100644 --- a/src/bundle/Resources/config/graphql/FieldDefinition.types.yaml +++ b/src/bundle/Resources/config/graphql/FieldDefinition.types.yaml @@ -194,7 +194,7 @@ SelectionFieldDefinitionSettings: type: Boolean options: type: "[SelectionFieldDefinitionOption]" - resolve: "@=query('SelectionFieldDefinitionOptions', [value['options']])" + resolve: "@=query('SelectionFieldDefinitionOptions', value['options'])" SelectionFieldDefinitionOption: type: object diff --git a/src/bundle/Resources/config/graphql/Item.types.yaml b/src/bundle/Resources/config/graphql/Item.types.yaml index 3f38a09..469ef6f 100644 --- a/src/bundle/Resources/config/graphql/Item.types.yaml +++ b/src/bundle/Resources/config/graphql/Item.types.yaml @@ -22,7 +22,7 @@ Item: type: String _thumbnail: type: Thumbnail - resolveType: "@=query('ItemType', [value])" + resolveType: "@=query('ItemType', value)" AbstractItem: type: "object" @@ -37,7 +37,7 @@ AbstractItem: _type: description: "The item's content type" type: ContentType - resolve: '@=query("ContentTypeById", [value.getContentInfo().contentTypeId])' + resolve: '@=query("ContentTypeById", value.getContentInfo().contentTypeId)' _contentInfo: description: 'Underlying content info item' type: Content @@ -49,7 +49,7 @@ AbstractItem: _allLocations: description: 'All the locations' type: '[Location]' - resolve: '@=query("LocationsByContentId", [value.getContentInfo().id])' + resolve: '@=query("LocationsByContentId", value.getContentInfo().id)' _name: description: "The content item's name, in the prioritized language(s), based on the object name pattern" type: String @@ -57,7 +57,7 @@ AbstractItem: _url: description: "The content item's url alias, based on the main location." type: String - resolve: "@=query('ItemUrlAlias', [value])" + resolve: "@=query('ItemUrlAlias', value)" _thumbnail: type: Thumbnail resolve: "@=query('Thumbnail', value.getContent().getThumbnail())" diff --git a/src/bundle/Resources/config/graphql/Location.types.yaml b/src/bundle/Resources/config/graphql/Location.types.yaml index ece9ea4..fb8e3c6 100644 --- a/src/bundle/Resources/config/graphql/Location.types.yaml +++ b/src/bundle/Resources/config/graphql/Location.types.yaml @@ -27,7 +27,7 @@ Location: parentLocation: type: "Location" description: "The parent location" - resolve: "@=query('LocationById', [value.parentLocationId])" + resolve: "@=query('LocationById', value.parentLocationId)" pathString: type: "String" description: "The path to the Location in the Tree." @@ -39,7 +39,7 @@ Location: description: "Depth location has in the location tree" children: type: "LocationConnection" - resolve: "@=query('LocationChildren', [{locationId: value.id}, args])" + resolve: "@=query('LocationChildren', {locationId: value.id}, args)" argsBuilder: 'Relay::Connection' args: sortBy: { type: '[LocationSortByOptions]', description: 'A sort clause, or array of clauses. Add _desc after a clause to reverse it' } @@ -48,13 +48,13 @@ Location: args: custom: type: "Boolean" - resolve: "@=query('LocationUrlAliases', [value, args])" + resolve: "@=query('LocationUrlAliases', value, args)" contentInfo: type: Content resolve: "@=value.getContentInfo()" content: type: DomainContent - resolve: "@=query('DomainContentItem', [{id: value.contentId}, null])" + resolve: "@=query('DomainContentItem', {id: value.contentId}, null)" LocationSortByOptions: type: enum diff --git a/src/bundle/Resources/config/graphql/Node.types.yaml b/src/bundle/Resources/config/graphql/Node.types.yaml index 75e9cbd..9a6a719 100644 --- a/src/bundle/Resources/config/graphql/Node.types.yaml +++ b/src/bundle/Resources/config/graphql/Node.types.yaml @@ -4,4 +4,4 @@ Node: type: relay-node config: - resolveType: '@=query("node_type", [value])' + resolveType: '@=query("node_type", value)' diff --git a/src/bundle/Resources/config/graphql/ObjectStateGroup.types.yaml b/src/bundle/Resources/config/graphql/ObjectStateGroup.types.yaml index d156e11..23db88b 100644 --- a/src/bundle/Resources/config/graphql/ObjectStateGroup.types.yaml +++ b/src/bundle/Resources/config/graphql/ObjectStateGroup.types.yaml @@ -18,4 +18,4 @@ ObjectStateGroup: states: type: "[ObjectState]" description: "List of ObjectStates under ObjectStateGroup." - resolve: "@=query('ObjectStatesByGroup', [value])" + resolve: "@=query('ObjectStatesByGroup', value)" diff --git a/src/bundle/Resources/config/graphql/Platform.types.yaml b/src/bundle/Resources/config/graphql/Platform.types.yaml index 0edd2d5..0dcb605 100644 --- a/src/bundle/Resources/config/graphql/Platform.types.yaml +++ b/src/bundle/Resources/config/graphql/Platform.types.yaml @@ -10,9 +10,9 @@ Platform: builder: Relay::Node builderConfig: nodeInterfaceType: Node - idFetcher: '@=query("node", [value])' + idFetcher: '@=query("node", value)' item: description: "An item, whatever its type" type: Item argsBuilder: "Item" - resolve: "@=query('Item', [args])" + resolve: "@=query('Item', args)" diff --git a/src/bundle/Resources/config/graphql/Repository.types.yaml b/src/bundle/Resources/config/graphql/Repository.types.yaml index f382cf1..e43f304 100644 --- a/src/bundle/Resources/config/graphql/Repository.types.yaml +++ b/src/bundle/Resources/config/graphql/Repository.types.yaml @@ -15,7 +15,7 @@ Repository: urlAlias: description: "A location url alias: 'path/to/content-item'" type: "String" - resolve: "@=query('Location', [args])" + resolve: "@=query('Location', args)" contentType: type: "ContentType" args: @@ -25,7 +25,7 @@ Repository: identifier: description: "Resolves using the unique ContentType identifier." type: "String" - resolve: "@=query('ContentType', [args])" + resolve: "@=query('ContentType', args)" contentTypes: type: "[ContentType]" args: @@ -33,7 +33,7 @@ Repository: type: "String" groupIdentifier: type: "String" - resolve: "@=query('ContentTypesFromGroup', [args])" + resolve: "@=query('ContentTypesFromGroup', args)" # # Object States @@ -46,7 +46,7 @@ Repository: id: type: "Int" description: "ID of the Object State Group" - resolve: "@=query('ObjectStateGroupById', [args])" + resolve: "@=query('ObjectStateGroupById', args)" objectStateGroups: type: '[ObjectStateGroup]' @@ -60,7 +60,7 @@ Repository: id: type: "Int" description: "ID of the Object State" - resolve: "@=query('ObjectStateById', [args])" + resolve: "@=query('ObjectStateById', args)" objectStates: type: '[ObjectState]' @@ -69,4 +69,4 @@ Repository: groupId: type: "Int" description: "ID of the ObjectStateGroup" - resolve: "@=query('ObjectStatesByGroupId', [args])" + resolve: "@=query('ObjectStatesByGroupId', args)" diff --git a/src/bundle/Resources/config/graphql/UrlAlias.types.yaml b/src/bundle/Resources/config/graphql/UrlAlias.types.yaml index 774ec38..e8abc6b 100644 --- a/src/bundle/Resources/config/graphql/UrlAlias.types.yaml +++ b/src/bundle/Resources/config/graphql/UrlAlias.types.yaml @@ -21,7 +21,7 @@ UrlAlias: type: "Boolean" forward: type: "Boolean" - resolveType: "@=query('UrlAliasType', [value])" + resolveType: "@=query('UrlAliasType', value)" LocationUrlAlias: type: object @@ -43,7 +43,7 @@ LocationUrlAlias: type: "Boolean" location: type: "Location" - resolve: "@=query('LocationById', [value.destination])" + resolve: "@=query('LocationById', value.destination)" interfaces: [UrlAlias] ResourceUrlAlias: diff --git a/src/bundle/Resources/config/graphql/User.types.yaml b/src/bundle/Resources/config/graphql/User.types.yaml index efb1307..1295a01 100644 --- a/src/bundle/Resources/config/graphql/User.types.yaml +++ b/src/bundle/Resources/config/graphql/User.types.yaml @@ -22,7 +22,7 @@ User: type: "Int" groups: type: "[UserGroup]" - resolve: "@=query('UserGroupsByUserId', [value.id])" + resolve: "@=query('UserGroupsByUserId', value.id)" thumbnail: type: Thumbnail resolve: "@=query('Thumbnail', value.getThumbnail())" @@ -47,10 +47,10 @@ UserGroup: resolve: "@=value.versionInfo" parentGroup: type: "UserGroup" - resolve: "@=query('UserGroupById', [value.parentId])" + resolve: "@=query('UserGroupById', value.parentId)" subGroups: type: "[UserGroup]" - resolve: "@=query('UserGroupSubGroups', [value])" + resolve: "@=query('UserGroupSubGroups', value)" users: type: "[User]" - resolve: "@=query('UsersOfGroup', [value])" + resolve: "@=query('UsersOfGroup', value)" diff --git a/src/bundle/Resources/config/graphql/Version.types.yaml b/src/bundle/Resources/config/graphql/Version.types.yaml index c39ec9a..fd0c4df 100644 --- a/src/bundle/Resources/config/graphql/Version.types.yaml +++ b/src/bundle/Resources/config/graphql/Version.types.yaml @@ -24,7 +24,7 @@ Version: type: "Int" creator: type: "User" - resolve: "@=query('UserById', [value.creatorId])" + resolve: "@=query('UserById', value.creatorId)" status: type: "Int" initialLanguageCode: diff --git a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/RelationFieldDefinitionMapper.php b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/RelationFieldDefinitionMapper.php index 395c5b3..5e65c87 100644 --- a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/RelationFieldDefinitionMapper.php +++ b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/RelationFieldDefinitionMapper.php @@ -69,7 +69,7 @@ public function mapToFieldValueResolver(FieldDefinition $fieldDefinition): ?stri $isMultiple = $this->isMultiple($fieldDefinition) ? 'true' : 'false'; - return sprintf('@=query("RelationFieldValue", [field, %s])', $isMultiple); + return sprintf('@=query("RelationFieldValue", field, %s)', $isMultiple); } protected function canMap(FieldDefinition $fieldDefinition) diff --git a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php index 3eb149f..356bd18 100644 --- a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php +++ b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php @@ -59,7 +59,7 @@ public function mapToFieldValueResolver(FieldDefinition $fieldDefinition): strin if (preg_match('/value, "(.*field.*)"/i', $resolver) !== 1) { $resolver = str_replace( 'field', - 'query("ItemFieldValue", [value, "' . $fieldDefinition->identifier . '", args])', + 'query("ItemFieldValue", value, "' . $fieldDefinition->identifier . '", args)', $resolver ); } diff --git a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/SelectionFieldDefinitionMapper.php b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/SelectionFieldDefinitionMapper.php index fcf5fc7..b2e496c 100644 --- a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/SelectionFieldDefinitionMapper.php +++ b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/SelectionFieldDefinitionMapper.php @@ -27,7 +27,7 @@ public function mapToFieldValueResolver(FieldDefinition $fieldDefinition): ?stri return parent::mapToFieldValueResolver($fieldDefinition); } - return '@=query("SelectionFieldValue", [field, content])'; + return '@=query("SelectionFieldValue", field, content)'; } protected function getFieldTypeIdentifier(): string diff --git a/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemOfTypeConnectionToGroup.php b/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemOfTypeConnectionToGroup.php index c7b7214..933ab44 100644 --- a/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemOfTypeConnectionToGroup.php +++ b/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemOfTypeConnectionToGroup.php @@ -27,7 +27,7 @@ public function work(Builder $schema, array $args) [ 'description' => isset($descriptions['eng-GB']) ? $descriptions['eng-GB'] : 'No description available', 'resolve' => sprintf( - '@=query("ItemsOfTypeAsConnection", ["%s", args])', + '@=query("ItemsOfTypeAsConnection", "%s", args)', $contentType->identifier ), 'argsBuilder' => 'Relay::Connection', diff --git a/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemToGroup.php b/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemToGroup.php index cf9cd96..2d074da 100644 --- a/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemToGroup.php +++ b/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemToGroup.php @@ -26,7 +26,7 @@ public function work(Builder $schema, array $args) $this->typeName($args), [ 'description' => isset($descriptions['eng-GB']) ? $descriptions['eng-GB'] : 'No description available', - 'resolve' => sprintf('@=query("ItemOfType", [args, "%s"])', $contentType->identifier), + 'resolve' => sprintf('@=query("ItemOfType", args, "%s")', $contentType->identifier), ] )); diff --git a/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemTypeToItemGroupTypes.php b/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemTypeToItemGroupTypes.php index 60d0ff3..df94451 100644 --- a/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemTypeToItemGroupTypes.php +++ b/src/lib/Schema/Domain/Content/Worker/ContentType/AddItemTypeToItemGroupTypes.php @@ -19,7 +19,7 @@ class AddItemTypeToItemGroupTypes extends BaseWorker implements Worker public function work(Builder $schema, array $args) { $resolve = sprintf( - '@=query("ContentType", [{"identifier": "%s"}])', + '@=query("ContentType", {"identifier": "%s"})', $args['ContentType']->identifier ); diff --git a/src/lib/Schema/Domain/Content/Worker/ContentTypeGroup/AddDomainGroupToDomain.php b/src/lib/Schema/Domain/Content/Worker/ContentTypeGroup/AddDomainGroupToDomain.php index de459fb..6a0b9ae 100644 --- a/src/lib/Schema/Domain/Content/Worker/ContentTypeGroup/AddDomainGroupToDomain.php +++ b/src/lib/Schema/Domain/Content/Worker/ContentTypeGroup/AddDomainGroupToDomain.php @@ -35,7 +35,7 @@ public function work(Builder $schema, array $args) [ 'description' => $contentTypeGroup->getDescription('eng-GB'), 'resolve' => sprintf( - '@=query("ContentTypeGroupByIdentifier", ["%s"])', + '@=query("ContentTypeGroupByIdentifier", "%s")', $contentTypeGroup->identifier ), ] From c98bfe30abd2891216d3af3d418628fbc12bb216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Sat, 4 Jan 2025 19:25:58 +0100 Subject: [PATCH 09/10] fixup! Replaced deprecated resolver expression function usage --- src/bundle/Resources/config/graphql/Base.types.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Resources/config/graphql/Base.types.yaml b/src/bundle/Resources/config/graphql/Base.types.yaml index 1745f2e..f4fe75d 100644 --- a/src/bundle/Resources/config/graphql/Base.types.yaml +++ b/src/bundle/Resources/config/graphql/Base.types.yaml @@ -23,7 +23,7 @@ DateTime: format: type: String description: "Date formatted with a date() format" - resolve: "@=query('DateTimeFormat', [value, args])" + resolve: "@=query('DateTimeFormat', value, args)" args: pattern: type: "String" From 072412e3003c420a5fe73942dd5cc91954b1db04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Sat, 4 Jan 2025 19:35:01 +0100 Subject: [PATCH 10/10] fixup! Replaced deprecated resolver expression function usage --- src/bundle/Resources/config/graphql/Content.types.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bundle/Resources/config/graphql/Content.types.yaml b/src/bundle/Resources/config/graphql/Content.types.yaml index 1057dcb..b453627 100644 --- a/src/bundle/Resources/config/graphql/Content.types.yaml +++ b/src/bundle/Resources/config/graphql/Content.types.yaml @@ -74,11 +74,11 @@ Content: reverseRelations: type: "[ContentRelation]" description: "Relations to this Content" - resolve: "@=query('ContentReverseRelations', [value])" + resolve: "@=query('ContentReverseRelations', value)" states: type: "[ObjectState]" description: "Content States." - resolve: "@=query('ObjectStateByContentInfo', [value])" + resolve: "@=query('ObjectStateByContentInfo', value)" ContentRelation: type: "object"