From 0d3b7958b6388bb01e98c7918091d98e4c0f6854 Mon Sep 17 00:00:00 2001 From: einanderson <289327658+einanderson@users.noreply.github.com> Date: Fri, 7 Aug 2026 01:51:15 +0200 Subject: [PATCH] Fix followed games: send the query document instead of a persisted query _get_followed() used a hardcoded persisted-query sha256 hash. Twitch rotates those hashes, and this one is no longer known, so the call only ever answers with PersistedQueryNotFound and "followed games" comes up empty. Send the full query document instead. The batched request and response shape stay the same, and so do the returned fields (id, name, displayName, boxArtURL, viewersCount), so callers need no change. Verified against gql.twitch.tv with a user token: the persisted variant returns PERSISTED_QUERY_NOT_FOUND, the query document returns the nodes. --- resources/lib/twitch/api/helix/games.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/resources/lib/twitch/api/helix/games.py b/resources/lib/twitch/api/helix/games.py index 19238fc..67b8a30 100644 --- a/resources/lib/twitch/api/helix/games.py +++ b/resources/lib/twitch/api/helix/games.py @@ -53,18 +53,17 @@ def _check_follows(username, name, headers={}): # undocumented / unsupported @query def _get_followed(limit=100, headers={}): + # Full query document rather than a persisted query: Twitch rotates the persisted + # hashes, and the previous one now only answers with PersistedQueryNotFound. data = [{ "operationName": "FollowingGames_CurrentUser", "variables": { "limit": limit, "type": "LIVE" }, - "extensions": { - "persistedQuery": { - "version": 1, - "sha256Hash": "8446d4d234005813dc1f024f487ce95434c3e4202f451dd42777935b5ed035ce" - } - } + "query": "query FollowingGames_CurrentUser($limit: Int!, $type: FollowedGamesType!) {" + " currentUser { followedGames(first: $limit, type: $type) {" + " nodes { id name displayName boxArtURL viewersCount } } } }" }] q = GQLQry('', headers=headers, data=data, use_token=False) return q