neo4j support `CALL {} (subquery)` since v3.5. It is an amazing feature. https://neo4j.com/docs/cypher-manual/4.1/clauses/call-subquery/