Hi @birjolaxew, you can use a apoc.do.when check up. If first list is empty your query will continue.
MERGE (t:Test)
WITH t, ['A', 'B'] as list
CALL apoc.do.when(
size(list)>0,
'UNWIND list AS name MERGE (t)-[:FOO_REL]->(a:Foo { name: name }) RETURN...