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.
Files changed (55) hide show
  1. {graphql_http-2.2.7 → graphql_http-2.2.8}/PKG-INFO +1 -1
  2. graphql_http-2.2.8/VERSION +1 -0
  3. {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http/server.py +2 -4
  4. {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http.egg-info/PKG-INFO +1 -1
  5. {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_server.py +27 -0
  6. graphql_http-2.2.7/VERSION +0 -1
  7. {graphql_http-2.2.7 → graphql_http-2.2.8}/.coverage +0 -0
  8. {graphql_http-2.2.7 → graphql_http-2.2.8}/.github/workflows/pages.yml +0 -0
  9. {graphql_http-2.2.7 → graphql_http-2.2.8}/.github/workflows/python-package.yml +0 -0
  10. {graphql_http-2.2.7 → graphql_http-2.2.8}/.gitignore +0 -0
  11. {graphql_http-2.2.7 → graphql_http-2.2.8}/.gitmodules +0 -0
  12. {graphql_http-2.2.7 → graphql_http-2.2.8}/LICENSE +0 -0
  13. {graphql_http-2.2.7 → graphql_http-2.2.8}/README.md +0 -0
  14. {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/.gitmodules +0 -0
  15. {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/_index.md +0 -0
  16. {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/_index.md +0 -0
  17. {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/api-reference.md +0 -0
  18. {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/authentication.md +0 -0
  19. {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/configuration.md +0 -0
  20. {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/examples.md +0 -0
  21. {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/getting-started.md +0 -0
  22. {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/content/docs/testing.md +0 -0
  23. {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/hugo.toml +0 -0
  24. {graphql_http-2.2.7 → graphql_http-2.2.8}/docs/index.md +0 -0
  25. {graphql_http-2.2.7 → graphql_http-2.2.8}/example_advanced_server.py +0 -0
  26. {graphql_http-2.2.7 → graphql_http-2.2.8}/examples/README.md +0 -0
  27. {graphql_http-2.2.7 → graphql_http-2.2.8}/examples/__init__.py +0 -0
  28. {graphql_http-2.2.7 → graphql_http-2.2.8}/examples/advanced_server.py +0 -0
  29. {graphql_http-2.2.7 → graphql_http-2.2.8}/examples/auth_server.py +0 -0
  30. {graphql_http-2.2.7 → graphql_http-2.2.8}/examples/basic_server.py +0 -0
  31. {graphql_http-2.2.7 → graphql_http-2.2.8}/examples/graphql_api_server.py +0 -0
  32. {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http/__init__.py +0 -0
  33. {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http/error.py +0 -0
  34. {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http/graphiql/index.html +0 -0
  35. {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http/helpers.py +0 -0
  36. {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http/introspection.py +0 -0
  37. {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http.egg-info/SOURCES.txt +0 -0
  38. {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http.egg-info/dependency_links.txt +0 -0
  39. {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http.egg-info/requires.txt +0 -0
  40. {graphql_http-2.2.7 → graphql_http-2.2.8}/graphql_http.egg-info/top_level.txt +0 -0
  41. {graphql_http-2.2.7 → graphql_http-2.2.8}/pyproject.toml +0 -0
  42. {graphql_http-2.2.7 → graphql_http-2.2.8}/setup.cfg +0 -0
  43. {graphql_http-2.2.7 → graphql_http-2.2.8}/test_server.py +0 -0
  44. {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/__init__.py +0 -0
  45. {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/app.py +0 -0
  46. {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/app_federation.py +0 -0
  47. {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/conftest.py +0 -0
  48. {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_auth.py +0 -0
  49. {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_cors.py +0 -0
  50. {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_examples.py +0 -0
  51. {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_federation.py +0 -0
  52. {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_graphql_api.py +0 -0
  53. {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_introspection.py +0 -0
  54. {graphql_http-2.2.7 → graphql_http-2.2.8}/tests/test_linting.py +0 -0
  55. {graphql_http-2.2.7 → graphql_http-2.2.8}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphql-http
3
- Version: 2.2.7
3
+ Version: 2.2.8
4
4
  Summary: HTTP Server for GraphQL.
5
5
  Author-email: Robert Parker <rob@parob.com>
6
6
  License: MIT
@@ -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 GraphQLHTTP(
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 = await run_in_threadpool(
537
- run_http_query,
535
+ execution_results, all_params = run_http_query(
538
536
  self.schema,
539
537
  request_method,
540
538
  data,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphql-http
3
- Version: 2.2.7
3
+ Version: 2.2.8
4
4
  Summary: HTTP Server for GraphQL.
5
5
  Author-email: Robert Parker <rob@parob.com>
6
6
  License: MIT
@@ -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."""
@@ -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