case insentive sorting #1087

This commit is contained in:
jokob-sk
2025-06-20 09:32:06 +10:00
parent 153383343b
commit 0034e49c1a
2 changed files with 3 additions and 1 deletions

View File

@@ -199,7 +199,9 @@ class Query(ObjectType):
for sort_option in options.sort:
devices_data = sorted(
devices_data,
key=lambda x: mixed_type_sort_key(x.get(sort_option.field)),
key=lambda x: mixed_type_sort_key(
x.get(sort_option.field).lower() if isinstance(x.get(sort_option.field), str) else x.get(sort_option.field)
),
reverse=(sort_option.order.lower() == "desc")
)