From ae090c7c4ec9619655ae95534b87a07aa7b2b061 Mon Sep 17 00:00:00 2001 From: Borislav Kosun Date: Mon, 23 Oct 2023 11:25:43 +0300 Subject: [PATCH] fix(graphql): use normalization context to get item from IRI (#5915) --- src/GraphQl/State/Provider/ReadProvider.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/GraphQl/State/Provider/ReadProvider.php b/src/GraphQl/State/Provider/ReadProvider.php index a96f6486d7d..e08e9e4ba2c 100644 --- a/src/GraphQl/State/Provider/ReadProvider.php +++ b/src/GraphQl/State/Provider/ReadProvider.php @@ -50,6 +50,11 @@ public function provide(Operation $operation, array $uriVariables = [], array $c $args = $context['args'] ?? []; + if ($this->serializerContextBuilder) { + // Builtin data providers are able to use the serialization context to automatically add join clauses + $context += $this->serializerContextBuilder->create($operation->getClass(), $operation, $context, true); + } + if (!$operation instanceof CollectionOperationInterface) { $identifier = $this->getIdentifierFromOperation($operation, $args); @@ -102,11 +107,6 @@ public function provide(Operation $operation, array $uriVariables = [], array $c $context['linkProperty'] = $info->fieldName; } - if ($this->serializerContextBuilder) { - // Builtin data providers are able to use the serialization context to automatically add join clauses - $context += $this->serializerContextBuilder->create($operation->getClass(), $operation, $context, true); - } - return $this->provider->provide($operation, $uriVariables, $context); }