diff --git a/composer.json b/composer.json index 2e8a18302..751ad2194 100644 --- a/composer.json +++ b/composer.json @@ -70,7 +70,7 @@ "drupal/focal_point": "^2.1.2", "drupal/facets": "^2.0.6", "drupal/gin": "^4.0", - "drupal/graphql": "^4.7", + "drupal/graphql": "^5.0-alpha1", "drupal/inline_entity_form": "^1.0-rc14", "drupal/ivw_integration": "^2.0", "drupal/length_indicator": "^1.2", @@ -111,7 +111,6 @@ "npm-asset/slick-carousel": "^1.8", "npm-asset/select2": "^4.0.7", "caxy/php-htmldiff": "^0.1.14", - "webonyx/graphql-php": "^14.11.8", "drupal/jquery_ui": "^1.6", "drupal/jquery_ui_draggable": "^2.1" }, diff --git a/modules/thunder_gqls/src/GraphQL/Buffers/SearchApiResultBuffer.php b/modules/thunder_gqls/src/GraphQL/Buffers/SearchApiResultBuffer.php index 354dfa53f..c0958c9a0 100644 --- a/modules/thunder_gqls/src/GraphQL/Buffers/SearchApiResultBuffer.php +++ b/modules/thunder_gqls/src/GraphQL/Buffers/SearchApiResultBuffer.php @@ -51,14 +51,14 @@ public function add($index, $id) { /** * {@inheritdoc} */ - protected function getBufferId($item) { + protected function getBufferId(\ArrayObject $item): string { return $item['index']; } /** * {@inheritdoc} */ - public function resolveBufferArray(array $buffer) { + protected function resolveBufferArray(array $buffer): array { $index = reset($buffer)['index']; $ids = array_map(function (\ArrayObject $item) { return (array) $item['id']; diff --git a/modules/thunder_gqls/src/Plugin/GraphQL/DataProducer/ThunderEntitySubRequestBase.php b/modules/thunder_gqls/src/Plugin/GraphQL/DataProducer/ThunderEntitySubRequestBase.php index 950bf5f06..7b47cb0b1 100644 --- a/modules/thunder_gqls/src/Plugin/GraphQL/DataProducer/ThunderEntitySubRequestBase.php +++ b/modules/thunder_gqls/src/Plugin/GraphQL/DataProducer/ThunderEntitySubRequestBase.php @@ -88,7 +88,7 @@ public function __construct( /** * {@inheritdoc} */ - public function resolveField(FieldContext $fieldContext) { + public function resolveField(FieldContext $field): mixed { $contextValues = $this->getContextValues(); if (!isset($contextValues['path'])) { @@ -96,7 +96,7 @@ public function resolveField(FieldContext $fieldContext) { } $url = $this->currentRequest->getSchemeAndHttpHost() . $contextValues['path']; - $request = $this->createRequest($this->currentRequest, $url, $fieldContext); + $request = $this->createRequest($this->currentRequest, $url, $field); $response = $this->httpKernel->handle($request, HttpKernelInterface::SUB_REQUEST); if ($response instanceof SubRequestResponse) { diff --git a/modules/thunder_gqls/src/Plugin/GraphQL/Schema/ThunderSchema.php b/modules/thunder_gqls/src/Plugin/GraphQL/Schema/ThunderSchema.php index 1afaa4f5a..6e3817dda 100644 --- a/modules/thunder_gqls/src/Plugin/GraphQL/Schema/ThunderSchema.php +++ b/modules/thunder_gqls/src/Plugin/GraphQL/Schema/ThunderSchema.php @@ -6,7 +6,6 @@ use Drupal\Core\Render\Element; use Drupal\Core\Url; use Drupal\graphql\GraphQL\ResolverRegistry; -use Drupal\graphql\GraphQL\ResolverRegistryInterface; use Drupal\graphql\Plugin\DataProducerPluginManager; use Drupal\graphql\Plugin\GraphQL\Schema\ComposableSchema; use Drupal\graphql\Plugin\GraphQL\Schema\SdlSchemaPluginBase; @@ -60,7 +59,7 @@ protected function setDataProducerManager(DataProducerPluginManager $pluginManag /** * {@inheritdoc} */ - public function getResolverRegistry(): ResolverRegistryInterface { + public function getResolverRegistry(): ResolverRegistry { $this->registry = new ResolverRegistry(); $this->createResolverBuilder(); diff --git a/modules/thunder_gqls/src/Traits/ResolverHelperTrait.php b/modules/thunder_gqls/src/Traits/ResolverHelperTrait.php index 5df7e48b4..33acfca26 100644 --- a/modules/thunder_gqls/src/Traits/ResolverHelperTrait.php +++ b/modules/thunder_gqls/src/Traits/ResolverHelperTrait.php @@ -4,6 +4,7 @@ use Drupal\graphql\GraphQL\Resolver\ResolverInterface; use Drupal\graphql\GraphQL\ResolverBuilder; +use Drupal\graphql\GraphQL\ResolverRegistry; use Drupal\graphql\GraphQL\ResolverRegistryInterface; /** @@ -19,11 +20,11 @@ trait ResolverHelperTrait { protected ResolverBuilder $builder; /** - * ResolverRegistryInterface. + * ResolverRegistry. * - * @var \Drupal\graphql\GraphQL\ResolverRegistryInterface + * @var \Drupal\graphql\GraphQL\ResolverRegistry */ - protected ResolverRegistryInterface $registry; + protected ResolverRegistry $registry; /** * Add field resolver to registry, if it does not already exist.