🔊 Log GraphQL errors in FastAPI People, because it returns 200, with a payload with an error (#9171)

This commit is contained in:
Sebastián Ramírez 2023-03-02 16:11:17 +01:00 committed by GitHub
parent 97effae92d
commit e9326de161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -381,6 +381,10 @@ def get_graphql_response(
logging.error(response.text)
raise RuntimeError(response.text)
data = response.json()
if "errors" in data:
logging.error(f"Errors in response, after: {after}, category_id: {category_id}")
logging.error(response.text)
raise RuntimeError(response.text)
return data