From 2251475bbe1dbec63fb854eab4eb6ed7fa9ecdb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Fri, 16 Jan 2026 19:59:05 +0100 Subject: [PATCH] Add operation names to debug view --- templates/twitch/debug.html | 21 +++++++++++++++++++++ twitch/views.py | 11 +++++++++++ 2 files changed, 32 insertions(+) diff --git a/templates/twitch/debug.html b/templates/twitch/debug.html index 4375f4d..5fb3b9d 100644 --- a/templates/twitch/debug.html +++ b/templates/twitch/debug.html @@ -7,6 +7,27 @@

Generated at:

+
+

Distinct GraphQL operation_names ({{ operation_names_with_counts|length }})

+ {% if operation_names_with_counts %} + + + + + + + + + {% for item in operation_names_with_counts %} + + + + + {% endfor %} + +
Operation NameCount
{{ item.trimmed_op }}{{ item.count }}
+ {% endif %} +

Games Without an Assigned Owner ({{ games_without_owner|length }})

{% if games_without_owner %} diff --git a/twitch/views.py b/twitch/views.py index 657a279..edccccd 100644 --- a/twitch/views.py +++ b/twitch/views.py @@ -950,6 +950,16 @@ def debug_view(request: HttpRequest) -> HttpResponse: .select_related("game") ) + # Distinct GraphQL operation names used to fetch campaigns with counts + operation_names_with_counts: list[dict[str, Any]] = list( + DropCampaign.objects + .annotate(trimmed_op=Trim("operation_name")) + .filter(~Q(trimmed_op__exact="")) + .values("trimmed_op") + .annotate(count=Count("twitch_id")) + .order_by("trimmed_op"), + ) + context: dict[str, Any] = { "now": now, "games_without_owner": games_without_owner, @@ -959,6 +969,7 @@ def debug_view(request: HttpRequest) -> HttpResponse: "invalid_date_campaigns": invalid_date_campaigns, "duplicate_name_campaigns": duplicate_name_campaigns, "active_missing_image": active_missing_image, + "operation_names_with_counts": operation_names_with_counts, } return render(