Add suggestions with fuzzy text search when no relationship is found (#2583)

This commit is contained in:
Laurence Isla
2022-12-15 18:33:15 -05:00
committed by GitHub
parent 566c6fe53f
commit 5a660e0cbe
6 changed files with 74 additions and 23 deletions
+1 -1
View File
@@ -208,7 +208,7 @@ getJoinConditions tblAlias parentAlias Relationship{relTable=qi,relForeignTable=
findRel :: Schema -> RelationshipsMap -> NodeName -> NodeName -> Maybe Hint -> Either ApiRequestError Relationship
findRel schema allRels origin target hint =
case rels of
[] -> Left $ NoRelBetween origin target schema
[] -> Left $ NoRelBetween origin target hint schema allRels
[r] -> Right r
rs -> Left $ AmbiguousRelBetween origin target rs
where