From 4f4672e33647ecc90a4f17a2647303ce60e9e97b Mon Sep 17 00:00:00 2001 From: robertSt7 Date: Thu, 14 Dec 2023 15:43:33 +0100 Subject: [PATCH] Fix: throw error message --- src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php b/src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php index 2826ba76..b09499ad 100644 --- a/src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php +++ b/src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php @@ -20,6 +20,7 @@ use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ElementIdentificationTrait; use Pimcore\Model\DataObject\Concrete; use Pimcore\Model\DataObject\Fieldcollection\Data\AbstractData; +use Pimcore\Model\Exception\NotFoundException; class ManyToManyRelation extends Base { @@ -45,6 +46,10 @@ public function process($object, $newValue, $args, $context, ResolveInfo $info) if ($element) { $result[] = $element; + } else { + throw new NotFoundException( + "Doesn't found element: " . $newValueItemValue['fullpath'] ?? $newValueItemValue['id'] + ); } } }