diff --git a/aql/convertQuery.go b/aql/convertQuery.go index 852571cc31f7b0c04f83a5cf8b6a6a9814adab07..e1e1fe4312676095599a83615f4766383928a190 100644 --- a/aql/convertQuery.go +++ b/aql/convertQuery.go @@ -159,9 +159,11 @@ func createQuery(JSONQuery *entity.IncomingQueryJSON) *string { if modifier.SelectedType == "entity" { // ASSUMING THERE IS ONLY 1 RELATION if JSONQuery.Relations[0].EntityFrom == modifier.ID { - pathDistinction = fmt.Sprintf(".vertices[%v]", JSONQuery.Relations[0].Depth.Min-1) + // This should always be 0, because that is the start of the path + pathDistinction = ".vertices[0]" } else { + // Otherwise take the depth.max -1 to get the last pathDistinction = fmt.Sprintf(".vertices[%v]", JSONQuery.Relations[0].Depth.Max) }