Skip to content

Commit

Permalink
fix(graphql): use normalization context to get item from IRI (#5915)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkosun authored and soyuka committed Oct 23, 2023
1 parent 6b5df95 commit ae090c7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/GraphQl/State/Provider/ReadProvider.php
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit ae090c7

Please sign in to comment.