strawberry-graphql 0.273.1__py3-none-any.whl → 0.273.3__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.
@@ -36,7 +36,7 @@ from strawberry.http.typevars import (
36
36
  from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
37
37
 
38
38
  if TYPE_CHECKING:
39
- from collections.abc import AsyncGenerator, Iterable, Mapping
39
+ from collections.abc import AsyncGenerator, Mapping, Sequence
40
40
 
41
41
  from strawberry.http import GraphQLHTTPResponse
42
42
  from strawberry.http.ides import GraphQL_IDE
@@ -68,7 +68,7 @@ class AiohttpHTTPRequestAdapter(AsyncHTTPRequestAdapter):
68
68
  data: dict[str, Any] = {}
69
69
  files: dict[str, Any] = {}
70
70
 
71
- async for field in reader:
71
+ while field := await reader.next():
72
72
  assert isinstance(field, BodyPartReader)
73
73
  assert field.name
74
74
 
@@ -144,7 +144,7 @@ class GraphQLView(
144
144
  keep_alive: bool = True,
145
145
  keep_alive_interval: float = 1,
146
146
  debug: bool = False,
147
- subscription_protocols: Iterable[str] = (
147
+ subscription_protocols: Sequence[str] = (
148
148
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
149
149
  GRAPHQL_WS_PROTOCOL,
150
150
  ),
@@ -360,7 +360,7 @@ class SyncGraphQLHTTPConsumer(
360
360
  def run(
361
361
  self,
362
362
  request: ChannelsRequest,
363
- context: Optional[Context] = UNSET,
363
+ context: Context = UNSET,
364
364
  root_value: Optional[RootValue] = UNSET,
365
365
  ) -> ChannelsResponse | MultipartChannelsResponse:
366
366
  return super().run(request, context, root_value)
@@ -19,7 +19,7 @@ from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_P
19
19
  from .base import ChannelsWSConsumer
20
20
 
21
21
  if TYPE_CHECKING:
22
- from collections.abc import AsyncGenerator, Mapping
22
+ from collections.abc import AsyncGenerator, Mapping, Sequence
23
23
 
24
24
  from strawberry.http import GraphQLHTTPResponse
25
25
  from strawberry.schema import BaseSchema
@@ -110,7 +110,7 @@ class GraphQLWSConsumer(
110
110
  keep_alive: bool = False,
111
111
  keep_alive_interval: float = 1,
112
112
  debug: bool = False,
113
- subscription_protocols: tuple[str, str] = (
113
+ subscription_protocols: Sequence[str] = (
114
114
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
115
115
  GRAPHQL_WS_PROTOCOL,
116
116
  ),
@@ -248,7 +248,7 @@ class AsyncBaseHTTPView(
248
248
  async def run(
249
249
  self,
250
250
  request: Request,
251
- context: Optional[Context] = UNSET,
251
+ context: Context = UNSET,
252
252
  root_value: Optional[RootValue] = UNSET,
253
253
  ) -> Response: ...
254
254
 
@@ -256,14 +256,14 @@ class AsyncBaseHTTPView(
256
256
  async def run(
257
257
  self,
258
258
  request: WebSocketRequest,
259
- context: Optional[Context] = UNSET,
259
+ context: Context = UNSET,
260
260
  root_value: Optional[RootValue] = UNSET,
261
261
  ) -> WebSocketResponse: ...
262
262
 
263
263
  async def run(
264
264
  self,
265
265
  request: Union[Request, WebSocketRequest],
266
- context: Optional[Context] = UNSET,
266
+ context: Context = UNSET,
267
267
  root_value: Optional[RootValue] = UNSET,
268
268
  ) -> Union[Response, WebSocketResponse]:
269
269
  root_value = (
@@ -287,7 +287,7 @@ class AsyncBaseHTTPView(
287
287
  await self.graphql_transport_ws_handler_class(
288
288
  view=self,
289
289
  websocket=websocket,
290
- context=context, # type: ignore
290
+ context=context,
291
291
  root_value=root_value, # type: ignore
292
292
  schema=self.schema,
293
293
  debug=self.debug,
@@ -297,7 +297,7 @@ class AsyncBaseHTTPView(
297
297
  await self.graphql_ws_handler_class(
298
298
  view=self,
299
299
  websocket=websocket,
300
- context=context, # type: ignore
300
+ context=context,
301
301
  root_value=root_value, # type: ignore
302
302
  schema=self.schema,
303
303
  debug=self.debug,
@@ -318,8 +318,6 @@ class AsyncBaseHTTPView(
318
318
  else context
319
319
  )
320
320
 
321
- assert context
322
-
323
321
  if not self.is_request_allowed(request_adapter):
324
322
  raise HTTPException(405, "GraphQL only supports GET and POST requests.")
325
323
 
@@ -11,7 +11,6 @@ from typing import (
11
11
 
12
12
  from graphql import GraphQLError
13
13
 
14
- from strawberry import UNSET
15
14
  from strawberry.exceptions import MissingQueryError
16
15
  from strawberry.file_uploads.utils import replace_placeholders_with_files
17
16
  from strawberry.http import (
@@ -24,6 +23,7 @@ from strawberry.schema import BaseSchema
24
23
  from strawberry.schema.exceptions import InvalidOperationTypeError
25
24
  from strawberry.types import ExecutionResult
26
25
  from strawberry.types.graphql import OperationType
26
+ from strawberry.types.unset import UNSET
27
27
 
28
28
  from .base import BaseView
29
29
  from .exceptions import HTTPException
@@ -166,7 +166,7 @@ class SyncBaseHTTPView(
166
166
  def run(
167
167
  self,
168
168
  request: Request,
169
- context: Optional[Context] = UNSET,
169
+ context: Context = UNSET,
170
170
  root_value: Optional[RootValue] = UNSET,
171
171
  ) -> Response:
172
172
  request_adapter = self.request_adapter_class(request)
@@ -187,8 +187,6 @@ class SyncBaseHTTPView(
187
187
  )
188
188
  root_value = self.get_root_value(request) if root_value is UNSET else root_value
189
189
 
190
- assert context
191
-
192
190
  try:
193
191
  result = self.execute_operation(
194
192
  request=request,
@@ -55,7 +55,7 @@ from strawberry.http.typevars import Context, RootValue
55
55
  from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
56
56
 
57
57
  if TYPE_CHECKING:
58
- from collections.abc import AsyncGenerator, AsyncIterator, Mapping
58
+ from collections.abc import AsyncGenerator, AsyncIterator, Mapping, Sequence
59
59
 
60
60
  from litestar.types import AnyCallable, Dependencies
61
61
  from strawberry.http import GraphQLHTTPResponse
@@ -253,7 +253,7 @@ class GraphQLController(
253
253
  graphql_ide: Optional[GraphQL_IDE] = "graphiql"
254
254
  debug: bool = False
255
255
  connection_init_wait_timeout: timedelta = timedelta(minutes=1)
256
- protocols: tuple[str, ...] = (
256
+ protocols: Sequence[str] = (
257
257
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
258
258
  GRAPHQL_WS_PROTOCOL,
259
259
  )
@@ -411,7 +411,7 @@ def make_graphql_controller(
411
411
  root_value_getter: Optional[AnyCallable] = None,
412
412
  # TODO: context typevar
413
413
  context_getter: Optional[AnyCallable] = None,
414
- subscription_protocols: tuple[str, ...] = (
414
+ subscription_protocols: Sequence[str] = (
415
415
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
416
416
  GRAPHQL_WS_PROTOCOL,
417
417
  ),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: strawberry-graphql
3
- Version: 0.273.1
3
+ Version: 0.273.3
4
4
  Summary: A library for creating GraphQL APIs
5
5
  License: MIT
6
6
  Keywords: graphql,api,rest,starlette,async
@@ -3,7 +3,7 @@ strawberry/__main__.py,sha256=3U77Eu21mJ-LY27RG-JEnpbh6Z63wGOom4i-EoLtUcY,59
3
3
  strawberry/aiohttp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  strawberry/aiohttp/test/__init__.py,sha256=4xxdUZtIISSOwjrcnmox7AvT4WWjowCm5bUuPdQneMg,71
5
5
  strawberry/aiohttp/test/client.py,sha256=8FKZTnvawxYpgEICOri-34O3wHRHLhRpjH_Ktp2EupQ,1801
6
- strawberry/aiohttp/views.py,sha256=v2VFRLmgUfWSVtPNs8_ia5mKuKgNMxbmXyBU2LDMRls,7895
6
+ strawberry/aiohttp/views.py,sha256=ffVZtxpjh7vs3VbqE6AkLTh0peEO9i9I484D_TJEuKc,7904
7
7
  strawberry/annotation.py,sha256=iqSXtJ4pTTLDZRPyil0f-yzpcCm8UYRiwvFWkD5LgpQ,13498
8
8
  strawberry/asgi/__init__.py,sha256=psdKl_52LGkxKKbzZlmwNGZ9jz2FLyLSC7fUhys4FqY,8169
9
9
  strawberry/asgi/test/__init__.py,sha256=4xxdUZtIISSOwjrcnmox7AvT4WWjowCm5bUuPdQneMg,71
@@ -13,8 +13,8 @@ strawberry/chalice/views.py,sha256=NBr_Chym4oMrhsr_kD4dx6gNnyBSBo8u7lKykRyfi4k,4
13
13
  strawberry/channels/__init__.py,sha256=AVmEwhzGHcTycMCnZYcZFFqZV8tKw9FJN4YXws-vWFA,433
14
14
  strawberry/channels/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  strawberry/channels/handlers/base.py,sha256=3mSvT2HMlOoWr0Y_8y1wwSmvCmB8osy2pEK1Kc5zJ5M,7841
16
- strawberry/channels/handlers/http_handler.py,sha256=zDwMVIjAiMVwsXOwq4Iy8IqwUAO8FNba3OPk76uWIGM,11647
17
- strawberry/channels/handlers/ws_handler.py,sha256=yw9HqwReLGGLcLcK_e4gDaQMua31_Ds7JGwuSD9REZQ,6169
16
+ strawberry/channels/handlers/http_handler.py,sha256=L_4zekdYMcUiE_654eATETe_FJGCiSpEP9ScU9x0KKI,11637
17
+ strawberry/channels/handlers/ws_handler.py,sha256=-Iao0rIuprnRmEpbxvFFyI_dR27_MeyO2iVkOv7qF00,6177
18
18
  strawberry/channels/router.py,sha256=DKIbl4zuRBhfvViUVpyu0Rf_WRT41E6uZC-Yic9Ltvo,2024
19
19
  strawberry/channels/testing.py,sha256=dc9mvSm9YdNOUgQk5ou5K4iE2h6TP5quKnk4Xdtn-IY,6558
20
20
  strawberry/cli/__init__.py,sha256=ibaAZsZEk76j9eK1zcbsCN9It-pd0rneCuEGPzhxJWA,647
@@ -134,17 +134,17 @@ strawberry/file_uploads/utils.py,sha256=-c6TbqUI-Dkb96hWCrZabh6TL2OabBuQNkCarOqg
134
134
  strawberry/flask/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
135
135
  strawberry/flask/views.py,sha256=MCvAsNgTZLU8RvTYKWfnLU2w7Wv1ZZpxW9W3TyTZuPY,6355
136
136
  strawberry/http/__init__.py,sha256=ytAirKk7K7D5knY21tpCGeZ-sCPgwMsijL5AxmOy-94,1163
137
- strawberry/http/async_base_view.py,sha256=RhCR58aHGpESgl_lSFSQgkrEFYFKCIE2SW5Lln5rxCo,20049
137
+ strawberry/http/async_base_view.py,sha256=UXzY0CU12uYZ-6LvqkIeryEn16OdRu8y94p-LgJTFNY,19963
138
138
  strawberry/http/base.py,sha256=MiX0-RqOkhRvlfpmuvgTHp4tygbUmG8fnLc0uCrOllU,2550
139
139
  strawberry/http/exceptions.py,sha256=9E2dreS1crRoJVUEPuHyx23NcDELDHNzkAOa-rGv-8I,348
140
140
  strawberry/http/ides.py,sha256=WjU0nsMDgr3Bd1ebWkUEkO2d1hk0dI16mLqXyCHqklA,613
141
141
  strawberry/http/parse_content_type.py,sha256=CYHO8F9b9DP1gJ1xxPjc9L2GkBwsyC1O_GCEp1QOuG0,381
142
- strawberry/http/sync_base_view.py,sha256=x_RQ7XdzwPmMl1vCh3bmgVvShQp28azSEkVMCX2o6Mc,7285
142
+ strawberry/http/sync_base_view.py,sha256=3T7rkAyqQfJpJTw0NENQyluT9QR4Rw-a_5BPT_2MGX4,7263
143
143
  strawberry/http/temporal_response.py,sha256=HTt65g-YxqlPGxjqvH5bzGoU1b3CctVR-9cmCRo5dUo,196
144
144
  strawberry/http/types.py,sha256=H0wGOdCO-5tNKZM_6cAtNRwZAjoEXnAC5N0Q7b70AtU,398
145
145
  strawberry/http/typevars.py,sha256=Uu6NkKe3h7o29ZWwldq6sJy4ioSSeXODTCDRvY2hUpE,489
146
146
  strawberry/litestar/__init__.py,sha256=zsXzg-mglCGUVO9iNXLm-yadoDSCK7k-zuyRqyvAh1w,237
147
- strawberry/litestar/controller.py,sha256=DSbjl7QGCY_TX77EomqDvtH8-ZK6wfhL81IUEFa-JJs,14124
147
+ strawberry/litestar/controller.py,sha256=d4qXnF1Rb1_HK4phELqeSbGg6oexiGoRnKFaLoTbkxY,14130
148
148
  strawberry/parent.py,sha256=JYFp-HGCgwbH2oB4uLSiIO4cVsoPaxX6lfYmxOKPkSg,1362
149
149
  strawberry/permission.py,sha256=dSRJMjSCmTlXfvfC24kCSrAk0txTjYKTJ5ZVU5IW91Y,7537
150
150
  strawberry/printer/__init__.py,sha256=DmepjmgtkdF5RxK_7yC6qUyRWn56U-9qeZMbkztYB9w,62
@@ -232,8 +232,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
232
232
  strawberry/utils/operation.py,sha256=CCIREeh3-CzjvjyjhmYPRCVDZUX36jAxF6LbK8r5wEw,1222
233
233
  strawberry/utils/str_converters.py,sha256=-eH1Cl16IO_wrBlsGM-km4IY0IKsjhjnSNGRGOwQjVM,897
234
234
  strawberry/utils/typing.py,sha256=SDvX-Du-9HAV3-XXjqi7Q5f5qPDDFd_gASIITiwBQT4,14073
235
- strawberry_graphql-0.273.1.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
236
- strawberry_graphql-0.273.1.dist-info/METADATA,sha256=YsQsBOvgQY2MezAlmXPFmuxsMciAMJV0g5Wtr9Zzh6A,7444
237
- strawberry_graphql-0.273.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
238
- strawberry_graphql-0.273.1.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
239
- strawberry_graphql-0.273.1.dist-info/RECORD,,
235
+ strawberry_graphql-0.273.3.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
236
+ strawberry_graphql-0.273.3.dist-info/METADATA,sha256=I0ZsVsO1wjkPWnRZeORNDtTmagpWN1jDNu7oZT9_DuE,7444
237
+ strawberry_graphql-0.273.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
238
+ strawberry_graphql-0.273.3.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
239
+ strawberry_graphql-0.273.3.dist-info/RECORD,,