-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: return a path in a query/mutation with @cypher #194
Comments
I have only found workarounds to achieve returning a path since I can't return it directly within the typedefs. I wanted to be able to return a simple path like (node)-[:relationship]->(node) multiple times but only achieve to return one path and not many. For this, I used a relationship like this one :
And I returned it in my query:
With this, I'm able to return the path with "(user)" and "(category)" nodes and the "[rated]" relationship. But when I try to return an array of Ratings like that:
On neo4j browser, if I run such a query, I can get the path directly if I But it seems that apoc isn't taking into account the second return somehow, perhaps because So I'd like to be able to return the corresponding categories and not always only one like in the screenshot. |
I tried to figure out a solution for that a while ago but it's not to pretty.
|
Expected feature example:
with something like:
but I get this error when I put a relationship type in another type like this:
I haven't found any way to return paths yet using the @cypher directive and even custom resolvers since we must specify a returned object in the typedefs.
I'm not very experienced with neo4j in general, but I feel that the power of neo4j and of graph databases in general, comes from the ability to create (merge, update, delete) and query a certain pattern/path, made of nodes and relationships consistently.
It seems like right now, I can get nodes on their own, relationships on their own, but not them linked together. So it takes many queries or different tricks to get the paths that I want which I fear might be hard to keep consistent when trying to use filter or Ordering and seems a lot less performant than being able to return a path directly.
I might be doing it wrong, but I haven't found any solution in the docs. Any solution right now is more than welcome. But if there are none, could it be added to the list of future features? I think it would be very useful and a greater developer experience.
P.S. I'll post what I've been able to achieve below, even if it doesn't work properly (or even at all) if it can help towards achieving this feature.
The text was updated successfully, but these errors were encountered: