formatQueryKey function
Formats a query key list into a human-readable string.
Each part is stringified; maps/lists are JSON-encoded. Parts are joined with ' › '.
Example: ['users', {'id': 1}] → 'users › {"id":1}'
Implementation
String formatQueryKey(dynamic key) {
if (key is String && key.isEmpty) return '';
final list = key is String ? jsonDecode(key) : key;
if (list is! Iterable) return list.toString();
return list.map((part) {
if (part is Map || part is List) return jsonEncode(part);
return part.toString();
}).join(' › ');
}