Closed tungv closed 5 years ago
So the issue here isn't one of precedence. It's that function application isn't available on a property of an object - I believe Cypher only supports explicitly named functions (i.e. Cypher does not have first-class functions).
Is this example taken from somewhere?
Thank Chris for responding. This is an oversimplified version of an automatically augmented query from the package https://github.com/neo4j-graphql/neo4j-graphql-js
The actual function is apoc.cypher.runFirstColumn
which is from a neo4j plugin.
When I try to escape the function name by wrapping it with backticks, it parses correctly:
MATCH (n)
RETURN `apoc.cypher.runFirstColumn`("<subquery>", { n: n }, false);
More information about Apoc plugin can be found here https://neo4j.com/developer/neo4j-apoc/
Got it. I'm unsure when support for that was added to opencypher, but it's a trivial thing to add here as well.
That said, I might have to talk to the opencypher team, as it's very odd. Rather than supporting apply as an expression on an object property, they're just allowing dot's in the function name itself (which is why `apoc.cypher.runFirstColumn`
works). That's potentially ambiguous, for the user at least!
this works:
output:
but this doesn't
output:
I think
apply
should have higher priority thanproperty