Created
June 20, 2024 17:32
-
-
Save elijahbenizzy/f34f875d7c43676f4b56214bd0ed3a5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run_cypher_query(graph, query): | |
try: | |
results = graph.ro_query(query).result_set | |
except: | |
results = {"error": "Query failed please try a different variation of this query"} | |
if len(results) == 0: | |
results = { | |
"error": "The query did not return any data, please make sure you're | |
"using the right edge directions and you're following the | |
"correct graph schema"} | |
return str(results) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment