diff --git a/src/GraphQL/DataObjectInputProcessor/AdvancedManyToManyObjectRelation.php b/src/GraphQL/DataObjectInputProcessor/AdvancedManyToManyObjectRelation.php index 450404979..7b3ac2aa6 100644 --- a/src/GraphQL/DataObjectInputProcessor/AdvancedManyToManyObjectRelation.php +++ b/src/GraphQL/DataObjectInputProcessor/AdvancedManyToManyObjectRelation.php @@ -42,6 +42,7 @@ public function process($object, $newValue, $args, $context, ResolveInfo $info) $result = []; if (is_array($newValue)) { foreach ($newValue as $newValueItemKey => $newValueItemValue) { + $columns = []; $element = $this->getElementByTypeAndIdOrPath($newValueItemValue); if ($element) { @@ -54,7 +55,7 @@ public function process($object, $newValue, $args, $context, ResolveInfo $info) } } $concrete = Concrete::getById($element->getId()); - $item = new ObjectMetadata($fieldName, $columns ?? [], $concrete); + $item = new ObjectMetadata($fieldName, $columns, $concrete); if ($data !== []) { $item->setData($data); }