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'] + ); } } }