There are no restrictions to using Cypher with CTEs (Common Table Expressions).

    Query:

    1. WITH graph_query as (
    2. SELECT *
    3. FROM cypher('graph_name', $$
    4. MATCH (n)
    5. RETURN n.name, n.age
    6. $$) as (name agtype, age agtype)
    7. )
    8. SELECT * FROM graph_query;

    Results:

    name age
    ‘Andres’ 36
    ‘Tobias’ 25
    ‘Peter’ 35
    3 row(s) returned