Skip to content

Commit d09d594

Browse files
committed
Correct query for delisting
1 parent 76ccfef commit d09d594

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

graphql.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,24 @@ def delist_post(self, post_id: str) -> bool:
127127
updatePost(input: $input) {
128128
post {
129129
id
130-
settings {
130+
preferences {
131131
delisted
132132
}
133133
}
134134
}
135135
}
136136
"""
137-
post_data = {"id": post_id, "settings": {"delisted": True}}
137+
post_data = {"id": post_id, "preferences": {"delisted": True}}
138138
response = self._execute_request(mutation, variables={"input": post_data})
139139

140140
try:
141-
delisted = response["data"]["updatePost"]["post"]["settings"]["delisted"]
142-
self.debug_data.append([datetime.now(ZoneInfo("UTC")), f"Delisted post: {post_id}, Delisted: {delisted}"])
141+
delisted = response["data"]["updatePost"]["post"]["preferences"]["delisted"]
142+
self.debug_data.append(
143+
[
144+
datetime.now(ZoneInfo("UTC")).strftime("%Y-%m-%d %H:%M:%S"),
145+
f"Delisted post: {post_id}, Delisted: {delisted}",
146+
]
147+
)
143148
return delisted
144149
except KeyError:
145150
self._log_failure("Failed to delist post", post_id, response)

0 commit comments

Comments
 (0)