I am submitting Cypher queries over the HTTP transactional endpoint in batches and began using a pattern of adding an expected value as part of my query. For example, a query like this:
MATCH (s {foo: 1}),
(e {bar: 1})
CREATE (s)-[:LINKS]->(e)
RETURN 1
would be submitted as:
{
"statement": <query>,
"parameters": null,
"expected": 1
}
the Neo4j client I wrote inspects the result and determines in it matches the expected result. The reason this is necessary is because if either MATCH fails, the CREATE will not occur and nothing will be returned. Since an error is not raised, I use the RETURN 1 as a sentinel for determining whether the query completely executed.
I was curious if the Neo4j team had any plans for providing a return value for Cypher query execution. Or consider an approach like this in which an agent can declare an expected value.