unwind ['A', 'B'] as input
match(n where n.name = input)
return n.name, collect(m) as children
Replace the literal array ['A','B'] with your parameter containing your inputs. Also, replace the match condition with your unique identifier and the relationship type in the pattern match with yours. The result is a row for each of your inputs, with a list of each input's direct connected nodes.
If you prefer a list instead of a collection, replace the 'return' clause with this return clause 'return n.name, m', giving the following alternative result:
If you want just a list of the child nodes, replace the return clause with this return clause 'return collect(m)', giving the following result: