strawberry-graphql 0.252.0__py3-none-any.whl → 0.253.0__py3-none-any.whl

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.
@@ -5,7 +5,6 @@ from datetime import timedelta
5
5
  from json import JSONDecodeError
6
6
  from typing import (
7
7
  TYPE_CHECKING,
8
- Any,
9
8
  AsyncGenerator,
10
9
  AsyncIterator,
11
10
  Callable,
@@ -185,7 +184,9 @@ class GraphQL(
185
184
  else: # pragma: no cover
186
185
  raise ValueError("Unknown scope type: {!r}".format(scope["type"]))
187
186
 
188
- async def get_root_value(self, request: Union[Request, WebSocket]) -> Optional[Any]:
187
+ async def get_root_value(
188
+ self, request: Union[Request, WebSocket]
189
+ ) -> Optional[RootValue]:
189
190
  return None
190
191
 
191
192
  async def get_context(
@@ -221,8 +221,8 @@ class GraphQLView(
221
221
  def get_root_value(self, request: HttpRequest) -> Optional[RootValue]:
222
222
  return None
223
223
 
224
- def get_context(self, request: HttpRequest, response: HttpResponse) -> Any:
225
- return StrawberryDjangoContext(request=request, response=response)
224
+ def get_context(self, request: HttpRequest, response: HttpResponse) -> Context:
225
+ return StrawberryDjangoContext(request=request, response=response) # type: ignore
226
226
 
227
227
  def get_sub_response(self, request: HttpRequest) -> TemporalHttpResponse:
228
228
  return TemporalHttpResponse()
@@ -276,11 +276,13 @@ class AsyncGraphQLView(
276
276
 
277
277
  return view
278
278
 
279
- async def get_root_value(self, request: HttpRequest) -> Any:
279
+ async def get_root_value(self, request: HttpRequest) -> Optional[RootValue]:
280
280
  return None
281
281
 
282
- async def get_context(self, request: HttpRequest, response: HttpResponse) -> Any:
283
- return StrawberryDjangoContext(request=request, response=response)
282
+ async def get_context(
283
+ self, request: HttpRequest, response: HttpResponse
284
+ ) -> Context:
285
+ return StrawberryDjangoContext(request=request, response=response) # type: ignore
284
286
 
285
287
  async def get_sub_response(self, request: HttpRequest) -> TemporalHttpResponse:
286
288
  return TemporalHttpResponse()
@@ -38,7 +38,6 @@ from fastapi.utils import generate_unique_id
38
38
  from strawberry.asgi import ASGIRequestAdapter, ASGIWebSocketAdapter
39
39
  from strawberry.exceptions import InvalidCustomContext
40
40
  from strawberry.fastapi.context import BaseContext, CustomContext
41
- from strawberry.http import process_result
42
41
  from strawberry.http.async_base_view import AsyncBaseHTTPView
43
42
  from strawberry.http.exceptions import HTTPException
44
43
  from strawberry.http.typevars import Context, RootValue
@@ -54,7 +53,6 @@ if TYPE_CHECKING:
54
53
  from strawberry.http import GraphQLHTTPResponse
55
54
  from strawberry.http.ides import GraphQL_IDE
56
55
  from strawberry.schema import BaseSchema
57
- from strawberry.types import ExecutionResult
58
56
 
59
57
 
60
58
  class GraphQLRouter(
@@ -268,11 +266,6 @@ class GraphQLRouter(
268
266
  async def render_graphql_ide(self, request: Request) -> HTMLResponse:
269
267
  return HTMLResponse(self.graphql_ide_html)
270
268
 
271
- async def process_result(
272
- self, request: Request, result: ExecutionResult
273
- ) -> GraphQLHTTPResponse:
274
- return process_result(result)
275
-
276
269
  async def get_context(
277
270
  self, request: Union[Request, WebSocket], response: Union[Response, WebSocket]
278
271
  ) -> Context: # pragma: no cover
@@ -1,8 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
- import json
4
3
  from dataclasses import dataclass
5
- from typing import TYPE_CHECKING, Any, Dict, List, Mapping, Optional
4
+ from typing import TYPE_CHECKING, Any, Dict, List, Optional
6
5
  from typing_extensions import Literal, TypedDict
7
6
 
8
7
  if TYPE_CHECKING:
@@ -36,25 +35,8 @@ class GraphQLRequestData:
36
35
  protocol: Literal["http", "multipart-subscription"] = "http"
37
36
 
38
37
 
39
- def parse_query_params(params: Dict[str, str]) -> Dict[str, Any]:
40
- if "variables" in params:
41
- params["variables"] = json.loads(params["variables"])
42
-
43
- return params
44
-
45
-
46
- def parse_request_data(data: Mapping[str, Any]) -> GraphQLRequestData:
47
- return GraphQLRequestData(
48
- query=data.get("query"),
49
- variables=data.get("variables"),
50
- operation_name=data.get("operationName"),
51
- )
52
-
53
-
54
38
  __all__ = [
55
39
  "GraphQLHTTPResponse",
56
40
  "process_result",
57
41
  "GraphQLRequestData",
58
- "parse_query_params",
59
- "parse_request_data",
60
42
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: strawberry-graphql
3
- Version: 0.252.0
3
+ Version: 0.253.0
4
4
  Summary: A library for creating GraphQL APIs
5
5
  Home-page: https://strawberry.rocks/
6
6
  License: MIT
@@ -5,7 +5,7 @@ strawberry/aiohttp/test/__init__.py,sha256=4xxdUZtIISSOwjrcnmox7AvT4WWjowCm5bUuP
5
5
  strawberry/aiohttp/test/client.py,sha256=xPwOo1V0XbC86LWHiSRTLcGNOa796flz49wzWmdkvSs,1775
6
6
  strawberry/aiohttp/views.py,sha256=q0L5JwIk-8TTnyy_4nfmBIve3DHnRb8YwOBP4qmvDLE,7867
7
7
  strawberry/annotation.py,sha256=u5rkFs6CDUaiJZMK7jp_VDUWdZZ3HXQEbR2ocruDpxA,13065
8
- strawberry/asgi/__init__.py,sha256=Pixb9ldPltXl-TChhF6zkmiyjxol-zu8PPmfWeDqExA,8130
8
+ strawberry/asgi/__init__.py,sha256=t8K3UIhSnyeI2yCxAh1BQwYfDCeaC4A-YhiMePoFMJo,8141
9
9
  strawberry/asgi/test/__init__.py,sha256=4xxdUZtIISSOwjrcnmox7AvT4WWjowCm5bUuPdQneMg,71
10
10
  strawberry/asgi/test/client.py,sha256=VolupxMna9ktF1lYgV_dUQAIN53DNzVyWTeWTbwsxqE,1448
11
11
  strawberry/chalice/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -49,7 +49,7 @@ strawberry/django/apps.py,sha256=ZWw3Mzv1Cgy0T9xT8Jr2_dkCTZjT5WQABb34iqnu5pc,135
49
49
  strawberry/django/context.py,sha256=XL85jDGAVnb2pwgm5uRUvIXwlGia3i-8ZVfKihf0T24,655
50
50
  strawberry/django/test/__init__.py,sha256=4xxdUZtIISSOwjrcnmox7AvT4WWjowCm5bUuPdQneMg,71
51
51
  strawberry/django/test/client.py,sha256=6dorWECd0wdn8fu3dabE-dfGK3uza58mGrdJ-xPct-w,626
52
- strawberry/django/views.py,sha256=jPb_J6-bXd_xb478Cv0nR5eLtRZN8CgvxlopkhckgJQ,9542
52
+ strawberry/django/views.py,sha256=ySmuTx5ZKBAyC4LPziMqzLJoRimLDF4bRsnrUYWf_oM,9612
53
53
  strawberry/exceptions/__init__.py,sha256=-yYcgv3cxEyDSxWyFId9j-yy2pNnXQC4lIpk7bHr8fs,6257
54
54
  strawberry/exceptions/conflicting_arguments.py,sha256=68f6kMSXdjuEjZkoe8o2I9PSIjwTS1kXsSGaQBPk_hI,1587
55
55
  strawberry/exceptions/duplicated_type_name.py,sha256=-FG5qG_Mvkd7ROdOxCB9bijf8QR6Olryf07mbAFC0-U,2210
@@ -110,7 +110,7 @@ strawberry/extensions/utils.py,sha256=YPiacKNLQXvpYj-HI6fR5ORFdM9RrcdabGeM7F8vBG
110
110
  strawberry/extensions/validation_cache.py,sha256=CZ-brPYA1grL_lW38Rq4TxEVKlHM2n1DC6q9BHlSF4g,1398
111
111
  strawberry/fastapi/__init__.py,sha256=p5qg9AlkYjNOWKcT4uRiebIpR6pIb1HqDMiDfF5O3tg,147
112
112
  strawberry/fastapi/context.py,sha256=07991DShQoYMBVyQl9Mh5xvXQSNQI2RXT2ZQ5fWiga4,690
113
- strawberry/fastapi/router.py,sha256=XdVgpNKyUfwNiqVSheXyWTNoODIbyxXY3imrLBZ_bYU,12242
113
+ strawberry/fastapi/router.py,sha256=yzu_z7jncHF4lmELpcosXC7W3NfQppn6bsHdsIMFGSg,11995
114
114
  strawberry/federation/__init__.py,sha256=FeUxLiBVuk9TKBmJJi51SeUaI8c80rS8hbl9No-hjII,535
115
115
  strawberry/federation/argument.py,sha256=2m_wgp7uFQDimTDDCBBqSoWeTop4MD1-KjjYrumEJIw,833
116
116
  strawberry/federation/enum.py,sha256=1rx50FiSMS-NjEFErhRSYB5no8TPsGMA_cH7hVbxAFI,3015
@@ -130,7 +130,7 @@ strawberry/file_uploads/scalars.py,sha256=NRDeB7j8aotqIkz9r62ISTf4DrxQxEZYUuHsX5
130
130
  strawberry/file_uploads/utils.py,sha256=2zsXg3QsKgGLD7of2dW-vgQn_Naf7I3Men9PhEAFYwM,1160
131
131
  strawberry/flask/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
132
132
  strawberry/flask/views.py,sha256=3gd1Xgxg3IT72dz2nrMBK094dMNxTUHciu3oofGOAG4,6235
133
- strawberry/http/__init__.py,sha256=GSvHUDXl1cHfLnb37PXOAnxfoXhvz0f467P1O8uDatM,1620
133
+ strawberry/http/__init__.py,sha256=ANVqO7G43gUzY4RCBvm1xyNZibf1SSfYnEdbdzxLhRI,1134
134
134
  strawberry/http/async_base_view.py,sha256=prPO8MfNwPjoOIEQLHkC-miL-mprg7XYcrJI4JBYTbs,15852
135
135
  strawberry/http/base.py,sha256=rfOH64-_b040YWRwqTCCA3ALjPoGxc110rmCxqfS4M4,2358
136
136
  strawberry/http/exceptions.py,sha256=9E2dreS1crRoJVUEPuHyx23NcDELDHNzkAOa-rGv-8I,348
@@ -229,8 +229,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
229
229
  strawberry/utils/operation.py,sha256=SSXxN-vMqdHO6W2OZtip-1z7y4_A-eTVFdhDvhKeLCk,1193
230
230
  strawberry/utils/str_converters.py,sha256=KGd7QH90RevaJjH6SQEkiVVsb8KuhJr_wv5AsI7UzQk,897
231
231
  strawberry/utils/typing.py,sha256=G6k2wWD1TDQ9WFk-Togekj_hTVFqHV-g7Phf2Wu41ms,14380
232
- strawberry_graphql-0.252.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
233
- strawberry_graphql-0.252.0.dist-info/METADATA,sha256=mMPtQtkqL-J5eRrC7agzkiowJdN2Ld-mXt0MW5_28Nc,7758
234
- strawberry_graphql-0.252.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
235
- strawberry_graphql-0.252.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
236
- strawberry_graphql-0.252.0.dist-info/RECORD,,
232
+ strawberry_graphql-0.253.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
233
+ strawberry_graphql-0.253.0.dist-info/METADATA,sha256=OaINI2ZdA8XCXFpWK_YH-v-3wMEM_62tr_tBlf7Cr6s,7758
234
+ strawberry_graphql-0.253.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
235
+ strawberry_graphql-0.253.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
236
+ strawberry_graphql-0.253.0.dist-info/RECORD,,