There are no restrictions to using Cypher with CTEs (Common Table Expressions).
Query:
WITH graph_query as (
SELECT *
FROM cypher('graph_name', $$
MATCH (n)
RETURN n.name, n.age
$$) as (name agtype, age agtype)
)
SELECT * FROM graph_query;
Results:
name | age |
‘Andres’ | 36 |
‘Tobias’ | 25 |
‘Peter’ | 35 |
3 row(s) returned |