Efficiently return the whole graph

neo4j version 5
AuraDB free tier
Web workspace query

I have a small test graph with 55 nodes and 110 relationships. What is a query that will return all the nodes and all the relationships, so I can see the whole thing at a glance?

I used to be able to do

MATCH (n) RETURN n

But the new version of the workspace won't return the relationships if I do that.

For a while I could still do

match p=()-[]-()
match (n)
return n, p

But now that runs into the hard-coded 5000 record limit. I assume I'm hitting that limit because this query is inefficient and will backtrack so many times through the graph that it hits nodes over 5000 times?

What would be a query that could do this more efficiently so I wouldn't hit the 5000 record limit with my smallish test graph?

chatGPT told me to use:

MATCH (n)
OPTIONAL MATCH (n)-[r]-(m)
RETURN COLLECT(DISTINCT n) AS nodes, COLLECT(DISTINCT r) AS relationships

which works! I guess the limit was on what was being returned, not on what was matched?