strawberry-graphql 0.219.1__py3-none-any.whl → 0.220.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.
@@ -69,6 +69,7 @@ class GraphQLWebsocketCommunicator(WebsocketCommunicator):
69
69
  path: str,
70
70
  headers: Optional[List[Tuple[bytes, bytes]]] = None,
71
71
  protocol: str = GRAPHQL_TRANSPORT_WS_PROTOCOL,
72
+ connection_params: dict = {},
72
73
  **kwargs: Any,
73
74
  ):
74
75
  """
@@ -81,6 +82,7 @@ class GraphQLWebsocketCommunicator(WebsocketCommunicator):
81
82
  self.protocol = protocol
82
83
  subprotocols = kwargs.get("subprotocols", [])
83
84
  subprotocols.append(protocol)
85
+ self.connection_params = connection_params
84
86
  super().__init__(application, path, headers, subprotocols=subprotocols)
85
87
 
86
88
  async def __aenter__(self) -> Self:
@@ -99,7 +101,9 @@ class GraphQLWebsocketCommunicator(WebsocketCommunicator):
99
101
  res = await self.connect()
100
102
  if self.protocol == GRAPHQL_TRANSPORT_WS_PROTOCOL:
101
103
  assert res == (True, GRAPHQL_TRANSPORT_WS_PROTOCOL)
102
- await self.send_json_to(ConnectionInitMessage().as_dict())
104
+ await self.send_json_to(
105
+ ConnectionInitMessage(payload=self.connection_params).as_dict()
106
+ )
103
107
  response = await self.receive_json_from()
104
108
  assert response == ConnectionAckMessage().as_dict()
105
109
  else:
@@ -6,7 +6,6 @@ from typing import (
6
6
  Any,
7
7
  List,
8
8
  NamedTuple,
9
- NoReturn,
10
9
  Set,
11
10
  Tuple,
12
11
  Type,
@@ -126,7 +125,7 @@ def get_default_factory_for_field(
126
125
 
127
126
  def ensure_all_auto_fields_in_pydantic(
128
127
  model: Type[BaseModel], auto_fields: Set[str], cls_name: str
129
- ) -> Union[NoReturn, None]:
128
+ ) -> None:
130
129
  # Raise error if user defined a strawberry.auto field not present in the model
131
130
  non_existing_fields = list(auto_fields - get_model_fields(model).keys())
132
131
 
@@ -135,4 +134,4 @@ def ensure_all_auto_fields_in_pydantic(
135
134
  fields=non_existing_fields, cls_name=cls_name, model=model
136
135
  )
137
136
  else:
138
- return None
137
+ return
@@ -65,7 +65,7 @@ def create_validator(max_alias_count: int) -> Type[ValidationRule]:
65
65
 
66
66
 
67
67
  def count_fields_with_alias(
68
- selection_set_owner: Union[ExecutableDefinitionNode, FieldNode, InlineFragmentNode]
68
+ selection_set_owner: Union[ExecutableDefinitionNode, FieldNode, InlineFragmentNode],
69
69
  ) -> int:
70
70
  if selection_set_owner.selection_set is None:
71
71
  return 0
strawberry/utils/aio.py CHANGED
@@ -24,7 +24,7 @@ async def aenumerate(
24
24
  i = 0
25
25
  async for element in iterable:
26
26
  yield i, element
27
- i += 1
27
+ i += 1 # noqa: SIM113
28
28
 
29
29
 
30
30
  async def aislice(
@@ -214,7 +214,7 @@ def _ast_replace_union_operation(expr: ast.Expr) -> ast.Expr:
214
214
 
215
215
 
216
216
  def _ast_replace_union_operation(
217
- expr: Union[ast.Expr, ast.expr]
217
+ expr: Union[ast.Expr, ast.expr],
218
218
  ) -> Union[ast.Expr, ast.expr]:
219
219
  if isinstance(expr, ast.Expr) and isinstance(
220
220
  expr.value, (ast.BinOp, ast.Subscript)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: strawberry-graphql
3
- Version: 0.219.1
3
+ Version: 0.220.0
4
4
  Summary: A library for creating GraphQL APIs
5
5
  Home-page: https://strawberry.rocks/
6
6
  License: MIT
@@ -53,7 +53,7 @@ Requires-Dist: pydantic (>1.6.1) ; extra == "pydantic"
53
53
  Requires-Dist: pygments (>=2.3,<3.0) ; extra == "debug-server" or extra == "cli"
54
54
  Requires-Dist: pyinstrument (>=4.0.0) ; extra == "pyinstrument"
55
55
  Requires-Dist: python-dateutil (>=2.7.0,<3.0.0)
56
- Requires-Dist: python-multipart (>=0.0.5,<0.0.7) ; extra == "asgi" or extra == "debug-server" or extra == "fastapi"
56
+ Requires-Dist: python-multipart (>=0.0.7) ; extra == "asgi" or extra == "debug-server" or extra == "fastapi"
57
57
  Requires-Dist: quart (>=0.19.3) ; extra == "quart"
58
58
  Requires-Dist: rich (>=12.0.0) ; extra == "debug" or extra == "debug-server" or extra == "cli"
59
59
  Requires-Dist: sanic (>=20.12.2) ; extra == "sanic"
@@ -25,7 +25,7 @@ strawberry/channels/handlers/graphql_ws_handler.py,sha256=PHRkwnXt3tY4E0XBVHh4hp
25
25
  strawberry/channels/handlers/http_handler.py,sha256=9pW978XaeF-aFWM9WMaSHCOWmcWoIJCNkW8X3lKJcws,9560
26
26
  strawberry/channels/handlers/ws_handler.py,sha256=sHL44eay4tNoKzkrRn3WewSYH-3ZSJzxJpmBJ-aTkeM,4650
27
27
  strawberry/channels/router.py,sha256=dyOBbSF8nFiygP0zz6MM14mhkvFQAEbbLBXzcpubSHM,1927
28
- strawberry/channels/testing.py,sha256=he9cdsu5KxoPfpR8z2E6kwr2hwUjVhACTrTIoIbsSkQ,5519
28
+ strawberry/channels/testing.py,sha256=IWj1CuIS3vOo2f2fw0W-0GCz-YSs7QSAAscC6suqtiI,5668
29
29
  strawberry/cli/__init__.py,sha256=OkUYNyurO-TyHcD_RsP1bjtNrxlM5gV6Ri6vs4asvvc,374
30
30
  strawberry/cli/app.py,sha256=tTMBV1pdWqMcwjWO2yn-8oLDhMhfJvUzyQtWs75LWJ0,54
31
31
  strawberry/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -90,7 +90,7 @@ strawberry/experimental/pydantic/error_type.py,sha256=Fy7m2E03a86XsF76UoAUeroiJL
90
90
  strawberry/experimental/pydantic/exceptions.py,sha256=GJt22DTolA24A0ZHcHsy-fcRkBnavgUZYOo0MBIVcjs,1427
91
91
  strawberry/experimental/pydantic/fields.py,sha256=m7LJEQ39wko4NRIjYPxhUbwNyZcubrbZmyBumG34CJM,5356
92
92
  strawberry/experimental/pydantic/object_type.py,sha256=kb1gwHw7vQCshk84a7DMRBp_9zDntrAK3bbI58vjqf0,12160
93
- strawberry/experimental/pydantic/utils.py,sha256=4vFNTyFLI6o9akUBf2ZNvWv-FFvQDm0F-i2_KagmQcE,3864
93
+ strawberry/experimental/pydantic/utils.py,sha256=vh9Mz33b5QhomuCMVygZ2mp2jrBOxVejIRK0XdfpygI,3828
94
94
  strawberry/ext/LICENSE,sha256=_oY0TZg0b_sW0--0T44aMTpy2e2zF1Kiyn8E1qDiivo,1249
95
95
  strawberry/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
96
  strawberry/ext/dataclasses/LICENSE,sha256=WZgm35K_3NJwLqxpEHJJi7CWxVrwTumEz5D3Dtd7WnA,13925
@@ -105,7 +105,7 @@ strawberry/extensions/directives.py,sha256=ulS80mDTDE-pM8d9IEk16O84kzjkXM1P4vMcq
105
105
  strawberry/extensions/disable_validation.py,sha256=eLlZ0SEuvK3HUSvLm4PpdgrtP30ckG25sV3hGd2W-sM,720
106
106
  strawberry/extensions/field_extension.py,sha256=1UXGdrPEz9y1m6OcsZTKTnPD1vMvWph3YOsk6QYtG5k,5643
107
107
  strawberry/extensions/mask_errors.py,sha256=D6Bga-op1vwdA07wpSZqssl1-wr3Pb56rQcjjyOv7UQ,1425
108
- strawberry/extensions/max_aliases.py,sha256=ID5nF-Dh0_N_4dPGkbDfWdGrBW7htbLK7-XYFNnFpFQ,2361
108
+ strawberry/extensions/max_aliases.py,sha256=aAKZ0xvSD72tNOtl7fQ6BOOB8qFjdADrTzAgMbVX18w,2362
109
109
  strawberry/extensions/max_tokens.py,sha256=Fa-Zcugo2Y1WRINTdTRWzsRhAnBFCLAoplfnlS8j_nY,1014
110
110
  strawberry/extensions/parser_cache.py,sha256=-HYjMsrLEBaHhwkNAXazXzvHMg2HSZ7BxN1LT02zCx0,1220
111
111
  strawberry/extensions/pyinstrument.py,sha256=hJZdF48eJ7QY-6rKalnUGNWK2ZrpFayUi1J0cj9tPC0,876
@@ -229,7 +229,7 @@ strawberry/types/types.py,sha256=t5MOV4xiutPL2Ka02u3Z2V3eqy2R2JPYQxsqCnY2Aqk,713
229
229
  strawberry/union.py,sha256=5DOzsmsrI4tU4aXO7BBEN-570ABQ9_VkRDvUJUrIofY,9926
230
230
  strawberry/unset.py,sha256=_180_Wxvw-umn-URMb3CmO-WegBfZHjVZW0L0RXrQrI,1097
231
231
  strawberry/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
232
- strawberry/utils/aio.py,sha256=nRu0VYg9RLpkY90t6UfUlCJhIS1qpmqLdQHlwTOK89g,1608
232
+ strawberry/utils/aio.py,sha256=ZAA7Y9nM55s9XlYTWqRjPHrO2O9zu5KElCz_dx25nG4,1624
233
233
  strawberry/utils/await_maybe.py,sha256=fgycBJZzaexrx0Vw0KbVZ4PJYoN_zh7F6Z0T-FObBdE,362
234
234
  strawberry/utils/dataclasses.py,sha256=BNnX7hDd-2sgiQpObyuCl3Zj-U16RiSyE2V53FrpdNQ,821
235
235
  strawberry/utils/debug.py,sha256=-MtRqM5e1J-GDNgKQXoVFcBB9f3dHvhEGrTc82uN4LM,1379
@@ -240,9 +240,9 @@ strawberry/utils/inspect.py,sha256=6z-tJpiWWm6E4-O6OUfhu689W9k1uY0m3FDwAfVCiNs,2
240
240
  strawberry/utils/logging.py,sha256=flS7hV0JiIOEdXcrIjda4WyIWix86cpHHFNJL8gl1y4,713
241
241
  strawberry/utils/operation.py,sha256=Um-tBCPl3_bVFN2Ph7o1mnrxfxBes4HFCj6T0x4kZxE,1135
242
242
  strawberry/utils/str_converters.py,sha256=avIgPVLg98vZH9mA2lhzVdyyjqzLsK2NdBw9mJQ02Xk,813
243
- strawberry/utils/typing.py,sha256=xkRDUaSJH669jtmdUvWIqrj66Vx4tsbrXSuuYy0FPxU,13490
244
- strawberry_graphql-0.219.1.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
245
- strawberry_graphql-0.219.1.dist-info/METADATA,sha256=KIk_A7mmdB8Ny1b4CYfcg-WFE6BIg3zYjyWoxoF3gsM,7747
246
- strawberry_graphql-0.219.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
247
- strawberry_graphql-0.219.1.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
248
- strawberry_graphql-0.219.1.dist-info/RECORD,,
243
+ strawberry/utils/typing.py,sha256=Qxz1LwyVsNGV7LQW1dFsaUbsswj5LHBOdKLMom5eyEA,13491
244
+ strawberry_graphql-0.220.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
245
+ strawberry_graphql-0.220.0.dist-info/METADATA,sha256=VPSyzPbXJPaCJWyTcloRXv5rSQply8Iv453lqySmXY0,7740
246
+ strawberry_graphql-0.220.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
247
+ strawberry_graphql-0.220.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
248
+ strawberry_graphql-0.220.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.8.1
2
+ Generator: poetry-core 1.9.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any