query
MATCH (a)
WHERE a.id = "some_id"
AND (
a.unmanaged IS NULL OR
a.unmanaged = false
) // visibility clause
OPTIONAL MATCH (a)-[r]->() // resource 'a' with outward relations 'r'
WITH a AS resourceProps,apoc.convert.toList(r) as refList, r
RETURN resourceProps, apoc.map.groupByMulti(refList, r.`_edgeType`) as output1
refList is null for some 'a's, if I return it. But apoc procedure is returning following error
Failed to invoke function
apoc.map.groupByMulti
: Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "values" is null
for below query
MATCH (a)
WHERE a.id = "saasops"
AND (
a.unmanaged IS NULL OR
a.unmanaged = false
) // visibility clause
OPTIONAL MATCH (a)-[r]->() // resource 'a' with outward relations 'r'
WITH a AS resourceProps,apoc.convert.toList(r) as refList, r
WITH resourceProps, refList, r,
CASE
WHEN refList is not null THEN apoc.map.groupByMulti(refList, r.`_edgeType`) END as output1
RETURN resourceProps, output1
output1 is empty {} for all 'a's