Slow response from HTTP API 5 with "resultDataContents": ["graph"]

Hi

I'm developing the neo2R R package to interact with neo4j from R using the HTTP API and SSL.

While adapting the package to support neo4j version 5, I've noticed a performance issue when I request results in a graph format ("resultDataContents": ["graph"])

For example, the following query takes less than 1 seconds with the default json result format but more than 90 seconds with result format set to "graph":
MATCH p=(f:TestNode)-[:TestEdge*5..5]->(t:TestNode) WHERE f.value < 3 RETURN p

The same query takes less than 1 second in the neo4j web browser

I observe this issue with version 5.12.0 of Neo4j but not with version 4.4.26.

Do you have an idea where this issue could come from and how it could be circumvented to allow the users of the neo2R package to get a graph from Neo4j?

Thank you for your help