Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Commit

Permalink
scripts: dump discussion: Fix comment reply iteration
Browse files Browse the repository at this point in the history
Signed-off-by: John Andersen <[email protected]>
  • Loading branch information
pdxjohnny committed Sep 5, 2023
1 parent 07ceb86 commit 70c1845
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/dump_discussion.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ async def fetch_discussion_data(session, token, owner, repo, discussion_number):
response = await session.post("https://api.github.com/graphql", headers=headers, json={"query": query, "variables": variables})
reply_result = await response.json()

reply_nodes = reply_result["data"]["repository"]["discussion"]["comments"]["nodes"][0]["replies"]["nodes"]
has_next_reply_page = reply_result["data"]["repository"]["discussion"]["comments"]["nodes"][0]["replies"]["pageInfo"]["hasNextPage"]
replies_cursor = reply_result["data"]["repository"]["discussion"]["comments"]["nodes"][0]["replies"]["pageInfo"]["endCursor"]
reply_nodes = comment["replies"]["nodes"]
has_next_reply_page = comment["replies"]["pageInfo"]["hasNextPage"]
replies_cursor = comment["replies"]["pageInfo"]["endCursor"]

for reply in reply_nodes:
replies.append(Reply(body=reply["body"]))
Expand Down

0 comments on commit 70c1845

Please sign in to comment.