Skip to content

Commit f8e2a75

Browse files
authored
Merge branch 'master' into chore_update_graphql_core_to_3_3_0
2 parents 71c5c1a + 3d85d64 commit f8e2a75

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

gql/transport/aiohttp.py

+3
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@ async def raise_response_error(resp: aiohttp.ClientResponse, reason: str):
325325
except Exception:
326326
await raise_response_error(resp, "Not a JSON answer")
327327

328+
if result is None:
329+
await raise_response_error(resp, "Not a JSON answer")
330+
328331
if "errors" not in result and "data" not in result:
329332
await raise_response_error(resp, 'No "data" or "errors" keys in answer')
330333

tests/test_aiohttp.py

+6
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,12 @@ async def handler(request):
299299
'No "data" or "errors" keys in answer: {"not_data_or_errors": 35}'
300300
),
301301
},
302+
{
303+
"response": "",
304+
"expected_exception": (
305+
"Server did not return a GraphQL result: Not a JSON answer: "
306+
),
307+
},
302308
]
303309

304310

0 commit comments

Comments
 (0)