Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-22-2021 03:09 PM
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
All the sessions of the conference are now available online