graphql-http 2.2.7__tar.gz → 2.2.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {graphql_http-2.2.7 → graphql_http-2.2.8}/PKG-INFO +1 -1
- graphql_http-2.2.8/VERSION +1 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http/server.py +2 -4
- {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http.egg-info/PKG-INFO +1 -1
- {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_server.py +27 -0
- graphql_http-2.2.7/VERSION +0 -1
- {graphql_http-2.2.7 → graphql_http-2.2.8}/.coverage +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/.github/workflows/pages.yml +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/.github/workflows/python-package.yml +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/.gitignore +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/.gitmodules +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/LICENSE +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/README.md +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/.gitmodules +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/_index.md +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/_index.md +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/api-reference.md +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/authentication.md +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/configuration.md +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/examples.md +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/getting-started.md +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/testing.md +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/hugo.toml +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/index.md +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/example_advanced_server.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/examples/README.md +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/examples/__init__.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/examples/advanced_server.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/examples/auth_server.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/examples/basic_server.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/examples/graphql_api_server.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http/__init__.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http/error.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http/graphiql/index.html +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http/helpers.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http/introspection.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http.egg-info/SOURCES.txt +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http.egg-info/dependency_links.txt +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http.egg-info/requires.txt +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http.egg-info/top_level.txt +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/pyproject.toml +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/setup.cfg +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/test_server.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/__init__.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/app.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/app_federation.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/conftest.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_auth.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_cors.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_examples.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_federation.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_graphql_api.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_introspection.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_linting.py +0 -0
- {graphql_http-2.2.7 → graphql_http-2.2.8}/uv.lock +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.2.8
|
|
@@ -13,7 +13,6 @@ from graphql.execution.execute import ExecutionContext
|
|
|
13
13
|
from graphql.type.schema import GraphQLSchema
|
|
14
14
|
from jwt import InvalidTokenError, PyJWKClient
|
|
15
15
|
from starlette.applications import Starlette
|
|
16
|
-
from starlette.concurrency import run_in_threadpool
|
|
17
16
|
from starlette.middleware import Middleware as StarletteMiddleware
|
|
18
17
|
from starlette.middleware.cors import CORSMiddleware
|
|
19
18
|
from starlette.requests import Request
|
|
@@ -73,7 +72,7 @@ class GraphQLHTTP:
|
|
|
73
72
|
middleware = executor.middleware
|
|
74
73
|
context = GraphQLContext(schema=schema, meta=meta, executor=executor)
|
|
75
74
|
|
|
76
|
-
return
|
|
75
|
+
return cls(
|
|
77
76
|
schema=schema,
|
|
78
77
|
root_value=root_value,
|
|
79
78
|
middleware=middleware,
|
|
@@ -533,8 +532,7 @@ class GraphQLHTTP:
|
|
|
533
532
|
for key, value in request.query_params.items():
|
|
534
533
|
query_data[key] = value
|
|
535
534
|
|
|
536
|
-
execution_results, all_params =
|
|
537
|
-
run_http_query,
|
|
535
|
+
execution_results, all_params = run_http_query(
|
|
538
536
|
self.schema,
|
|
539
537
|
request_method,
|
|
540
538
|
data,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import pytest
|
|
2
|
+
import starlette.concurrency
|
|
2
3
|
|
|
3
4
|
from graphql import (
|
|
4
5
|
GraphQLSchema,
|
|
@@ -219,6 +220,32 @@ class TestGraphQLHTTPCore:
|
|
|
219
220
|
assert "errors" in result
|
|
220
221
|
assert "Batch GraphQL requests are not enabled" in result["errors"][0]["message"]
|
|
221
222
|
|
|
223
|
+
def test_from_api_returns_subclass(self, schema):
|
|
224
|
+
"""from_api should instantiate cls so subclasses are honored."""
|
|
225
|
+
from graphql_api import GraphQLAPI
|
|
226
|
+
|
|
227
|
+
class CustomGraphQLHTTP(GraphQLHTTP):
|
|
228
|
+
pass
|
|
229
|
+
|
|
230
|
+
class API(GraphQLAPI):
|
|
231
|
+
@property
|
|
232
|
+
def query(self):
|
|
233
|
+
return schema.query_type
|
|
234
|
+
|
|
235
|
+
server = CustomGraphQLHTTP.from_api(API())
|
|
236
|
+
assert isinstance(server, CustomGraphQLHTTP)
|
|
237
|
+
|
|
238
|
+
def test_dispatch_does_not_use_threadpool(self, monkeypatch, client):
|
|
239
|
+
"""dispatch should execute GraphQL setup on request loop, not threadpool."""
|
|
240
|
+
|
|
241
|
+
async def _fail(*args, **kwargs):
|
|
242
|
+
raise AssertionError("run_in_threadpool should not be used")
|
|
243
|
+
|
|
244
|
+
monkeypatch.setattr(starlette.concurrency, "run_in_threadpool", _fail)
|
|
245
|
+
response = client.post("/graphql", json={"query": "{ hello }"})
|
|
246
|
+
assert response.status_code == 200
|
|
247
|
+
assert response.json() == {"data": {"hello": "Hello, World!"}}
|
|
248
|
+
|
|
222
249
|
|
|
223
250
|
class TestGraphQLHTTPMiddleware:
|
|
224
251
|
"""Test middleware functionality."""
|
graphql_http-2.2.7/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.2.7
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|