Skip to content

Commit 28387f5

Browse files
committed
Make more tests pass
1 parent 90ddc1b commit 28387f5

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/graphql_server/http/async_base_view.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@ async def run(
345345
except KeyError as e:
346346
raise HTTPException(400, "File(s) missing in form data") from e
347347

348+
if request_data.variables is not None and not isinstance(request_data.variables, dict):
349+
raise HTTPException(400, "Variables must be a JSON object")
350+
348351
allowed_operation_types = operation_type_from_http(request_adapter.method)
349352

350353
if request_adapter.method == "GET":

src/graphql_server/http/sync_base_view.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ def run(
200200
except KeyError as e:
201201
raise HTTPException(400, "File(s) missing in form data") from e
202202

203+
if request_data.variables is not None and not isinstance(request_data.variables, dict):
204+
raise HTTPException(400, "Variables must be a JSON object")
205+
203206
allowed_operation_types = operation_type_from_http(request_adapter.method)
204207

205208
if request_adapter.method == "GET":

src/graphql_server/subscriptions/protocols/graphql_transport_ws/handlers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ async def run_operation(self, operation: Operation[Context, RootValue]) -> None:
307307
else:
308308
is_first_result = True
309309
async for result in result_source:
310-
print("RESULT SOURCE", result, is_first_result)
311310
if (
312311
is_first_result
313312
and result.errors

src/tests/http/test_graphql_over_http_spec.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,6 @@ async def test_022_(http_client, parameter):
369369
assert "errors" not in response.json
370370

371371

372-
@pytest.mark.xfail(
373-
reason="OPTIONAL - Currently results in lots of TypeErrors", raises=AssertionError
374-
)
375372
@pytest.mark.parametrize(
376373
"invalid",
377374
["string", 0, False, ["array"]],

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy