Skip to content

Commit

Permalink
[DocumentResolver] Hardlink - optimize resolveTarget - related to pim…
Browse files Browse the repository at this point in the history
  • Loading branch information
dvesh3 committed Jun 27, 2023
1 parent fbe90c3 commit 8b17029
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/GraphQL/DocumentResolver/Hardlink.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ public function resolveTarget($value = null, $args = [], $context = [], ResolveI
$document = Document::getById($documentId);

if ($document instanceof Document\Hardlink) {
$sourceId = $document->getSourceId();
$relation = Document::getById($sourceId);
if ($relation) {
return RelationHelper::processRelation($relation, $this->getGraphQlService(), $args, $context, $resolveInfo);
if ($relation = $document->getSourceDocument()) {
return RelationHelper::processRelation(
$relation,
$this->getGraphQlService(),
$args,
$context,
$resolveInfo
);
}
}

Expand Down

0 comments on commit 8b17029

Please sign in to comment.