Fix nodes_count query bind_vars - only add bounds when present
All checks were successful
Build Docker Image / build (push) Successful in 1m16s

This commit is contained in:
Ruslan Bakiev
2026-01-25 22:01:54 +07:00
parent 2e7f5e7863
commit 81f86b6538

View File

@@ -541,14 +541,21 @@ class Query(graphene.ObjectType):
COLLECT WITH COUNT INTO length COLLECT WITH COUNT INTO length
RETURN length RETURN length
""" """
cursor = db.aql.execute(aql, bind_vars={ bind_vars = {
'transport_type': transport_type, 'transport_type': transport_type,
'country': country, 'country': country,
}
# Only add bounds to bind_vars if they are used
if west is not None and south is not None and east is not None and north is not None:
bind_vars.update({
'west': west, 'west': west,
'south': south, 'south': south,
'east': east, 'east': east,
'north': north, 'north': north,
}) })
cursor = db.aql.execute(aql, bind_vars=bind_vars)
return next(cursor, 0) return next(cursor, 0)
def resolve_hub_countries(self, info): def resolve_hub_countries(self, info):