Skip to content

Commit

Permalink
fix queries
Browse files Browse the repository at this point in the history
  • Loading branch information
gkorland committed Dec 20, 2023
1 parent 56a5c49 commit 3d179a0
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/falkordb.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,14 @@ def get_graph_data(self) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]:
nodes = self.driver.query(
"""
MATCH (n)
WITH collect(
{data: {id: n.id, label: n.label, color: n.color}}) AS node
RETURN node
RETURN {id: n.id, label: n.label, color: n.color}
"""
)
nodes = [el["node"] for el in nodes][0]

edges = self.driver.query(
"""
MATCH (s)-[r]->(t)
WITH collect(
{data: {source: s.id, target: t.id, label:r.type, color: r.color}}
) AS rel
RETURN rel
return {source: s.id, target: t.id, label:r.type, color: r.color}
"""
)
edges = [el["rel"] for el in edges][0]
Expand Down

0 comments on commit 3d179a0

Please sign in to comment.