cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Retrieving a graph via GraphQL

pingelsan
Node Clone

The result of a GraphQL query is usually a tree.
Is there a way to retrieve a graph via GraphQL?
To give an example: If I have a graph (in neo4j) where Joe, Amy and Bob are mutual friends, I can query like this:

{Person(name: "Joe") {
    name
    friends {
        name
    }
}

With this query, I get the information that Amy and Bob are both friends of Joe.
Now, it there a way to retrieve from the graph db the fact that Amy and Bob are also friends?
Background is that I want to display the immediate context of a node as completely as possible, using react-sigma to display the graph.
One idea that comes to mind is to make the query "semi-recursive" by nesting another friends field inside friends and then use the returned IDs to reconstruct the edges.
Is this a sound approach, or are there more straightforward ways / best practices?

Thanks for any input,
best regards,
Chris

0 REPLIES 0