diff --git a/src/GraphQL/DataObjectInputProcessor/ManyToOneRelation.php b/src/GraphQL/DataObjectInputProcessor/ManyToOneRelation.php index a11b029b..a423e7a6 100644 --- a/src/GraphQL/DataObjectInputProcessor/ManyToOneRelation.php +++ b/src/GraphQL/DataObjectInputProcessor/ManyToOneRelation.php @@ -44,15 +44,15 @@ public function process($object, $newValue, $args, $context, ResolveInfo $info): if (is_array($newValue)) { $element = $this->getElementByTypeAndIdOrPath($newValue); - } - - if (!$element) { - throw new NotFoundException( - sprintf('Element with id %s or fullpath %s not found', - $newValue['id'], - $newValue['fullpath'] - ) - ); + + if (!$element) { + throw new NotFoundException( + sprintf('Element with id %s or fullpath %s not found', + $newValue['id'], + $newValue['fullpath'] + ) + ); + } } return $container->$setter($element);