cancel
Showing results for 
Search instead for 
Did you mean: 

Why the new library @neo4j/graphql doesn't retrieve nested data automatically from type

john3haris
Node Clone

I have just migrated and the stream was very helpful, but one thing that seems to be off is when retrieving nested data.
Let's say I have a Post type and some of its properties need to have a custom @cypher directive or a relationship directive, like this.

type Post {
  post_id: String
  timestamp: String 
  author: User @relationship(type: "CREATED", direction: IN)
  likes_count: Int @cypher(statement: "RETURN SIZE((this)<-[:LIKES]-())")
}

but when creating a custom function the custom properties are not retrieved eg; (author, likes_count). It can also be seen here on the stream at minute 52:35.
When I modify the custom function so it would retrieve post { .*, author: (cypher_function_here), likes_count : (cypher_function_here) } It does return the result as expected, but the question here is Why it doesn't do so automagically 😉? as it used to do with the previous library neo4j-graphql-js. Or did I miss something and I need to modify the Post type?
Thank you.

2 REPLIES 2

DomVinyard
Node Link

There is a ticket open here: GraphQL Queries do not return relationship data on custom cypher queries · Issue #227 · neo4j/graphq...

Might be worth adding your voice to get this more attention

Looks like I'm not the only one facing this issue.. It has kept me from migrating.
I see that there was already a discussion held there, So we'll just wait. As for me, this @cypher relationship thing is crucial for me as I need it in tens of my queries and this keeps me from migrating (for now).

Thank you @DomVinyard for letting me know about the open Github issue. I'll make sure to add my voice to you'll and hoping for a fix soon.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.