From aba7459df199b3cb6f83e2f0bed666a56b4a77a1 Mon Sep 17 00:00:00 2001 From: Daniel Bosen Date: Mon, 27 Nov 2023 13:06:59 +0100 Subject: [PATCH] revert unrelated --- .../src/Traits/ResolverHelperTrait.php | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/modules/thunder_gqls/src/Traits/ResolverHelperTrait.php b/modules/thunder_gqls/src/Traits/ResolverHelperTrait.php index 9505894b0..5dcaac0ec 100644 --- a/modules/thunder_gqls/src/Traits/ResolverHelperTrait.php +++ b/modules/thunder_gqls/src/Traits/ResolverHelperTrait.php @@ -54,27 +54,14 @@ protected function createResolverBuilder(): void { * Name of the filed. * @param \Drupal\graphql\GraphQL\Resolver\ResolverInterface|null $entity * Entity to get the field property. - * @param bool $multiValue - * Whether the field is returns multiple values. * - * @return \Drupal\graphql\GraphQL\Resolver\Composite + * @return \Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerProxy * The field data producer. */ - public function fromEntityReference(string $field, ResolverInterface $entity = NULL, bool $multiValue = TRUE) { - return $this->builder->compose( - $this->builder->produce('entity_reference') - ->map('field', $this->builder->fromValue($field)) - ->map('entity', $entity ?: $this->builder->fromParent()), - $this->builder->callback(function ($parent) use ($multiValue) { - if ($multiValue) { - return $parent; - } - if (!empty($parent[0])) { - return $parent[0]; - } - return NULL; - }) - ); + public function fromEntityReference(string $field, ResolverInterface $entity = NULL) { + return $this->builder->produce('entity_reference') + ->map('field', $this->builder->fromValue($field)) + ->map('entity', $entity ?: $this->builder->fromParent()); } /**