Skip to content

Commit e10cc5e

Browse files
authored
fix(graphql): use normalization context to get item from IRI (#5915)
1 parent 6b79b6f commit e10cc5e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/GraphQl/State/Provider/ReadProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ public function provide(Operation $operation, array $uriVariables = [], array $c
5050

5151
$args = $context['args'] ?? [];
5252

53+
if ($this->serializerContextBuilder) {
54+
// Builtin data providers are able to use the serialization context to automatically add join clauses
55+
$context += $this->serializerContextBuilder->create($operation->getClass(), $operation, $context, true);
56+
}
57+
5358
if (!$operation instanceof CollectionOperationInterface) {
5459
$identifier = $this->getIdentifierFromOperation($operation, $args);
5560

@@ -102,11 +107,6 @@ public function provide(Operation $operation, array $uriVariables = [], array $c
102107
$context['linkProperty'] = $info->fieldName;
103108
}
104109

105-
if ($this->serializerContextBuilder) {
106-
// Builtin data providers are able to use the serialization context to automatically add join clauses
107-
$context += $this->serializerContextBuilder->create($operation->getClass(), $operation, $context, true);
108-
}
109-
110110
return $this->provider->provide($operation, $uriVariables, $context);
111111
}
112112

0 commit comments

Comments
 (0)