strawberry-graphql 0.214.0__py3-none-any.whl → 0.214.0.dev1701082152__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.
@@ -22,7 +22,7 @@ class ChaliceHTTPRequestAdapter(SyncHTTPRequestAdapter):
22
22
 
23
23
  @property
24
24
  def query_params(self) -> QueryParams:
25
- return self.request.query_params or {}
25
+ return self.request.query_params or {} # type: ignore
26
26
 
27
27
  @property
28
28
  def body(self) -> Union[str, bytes]:
@@ -660,7 +660,7 @@ class QueryCodegen:
660
660
  elif isinstance(type_, StrawberryList):
661
661
  type_, wrapper = self._unwrap_type(type_.of_type)
662
662
  wrapper = (
663
- GraphQLList if wrapper is None else lambda t: GraphQLList(wrapper(t))
663
+ GraphQLList if wrapper is None else lambda t: GraphQLList(wrapper(t)) # type: ignore[misc]
664
664
  )
665
665
 
666
666
  elif isinstance(type_, LazyType):
@@ -88,77 +88,78 @@ async def execute(
88
88
  extensions=list(extensions),
89
89
  )
90
90
 
91
- async with extensions_runner.operation():
92
- # Note: In graphql-core the schema would be validated here but in
93
- # Strawberry we are validating it at initialisation time instead
94
- if not execution_context.query:
95
- raise MissingQueryError()
96
-
97
- async with extensions_runner.parsing():
98
- try:
99
- if not execution_context.graphql_document:
100
- execution_context.graphql_document = parse_document(
101
- execution_context.query, **execution_context.parse_options
91
+ try:
92
+ async with extensions_runner.operation():
93
+ # Note: In graphql-core the schema would be validated here but in
94
+ # Strawberry we are validating it at initialisation time instead
95
+ if not execution_context.query:
96
+ raise MissingQueryError()
97
+
98
+ async with extensions_runner.parsing():
99
+ try:
100
+ if not execution_context.graphql_document:
101
+ execution_context.graphql_document = parse_document(
102
+ execution_context.query, **execution_context.parse_options
103
+ )
104
+
105
+ except GraphQLError as exc:
106
+ execution_context.errors = [exc]
107
+ process_errors([exc], execution_context)
108
+ return ExecutionResult(
109
+ data=None,
110
+ errors=[exc],
111
+ extensions=await extensions_runner.get_extensions_results(),
102
112
  )
103
113
 
104
- except GraphQLError as error:
105
- execution_context.errors = [error]
106
- process_errors([error], execution_context)
107
- return ExecutionResult(
108
- data=None,
109
- errors=[error],
110
- extensions=await extensions_runner.get_extensions_results(),
111
- )
112
-
113
- except Exception as error: # pragma: no cover
114
- error = GraphQLError(str(error), original_error=error)
115
-
116
- execution_context.errors = [error]
117
- process_errors([error], execution_context)
118
-
119
- return ExecutionResult(
120
- data=None,
121
- errors=[error],
122
- extensions=await extensions_runner.get_extensions_results(),
123
- )
124
-
125
- if execution_context.operation_type not in allowed_operation_types:
126
- raise InvalidOperationTypeError(execution_context.operation_type)
127
-
128
- async with extensions_runner.validation():
129
- _run_validation(execution_context)
130
- if execution_context.errors:
131
- process_errors(execution_context.errors, execution_context)
132
- return ExecutionResult(data=None, errors=execution_context.errors)
133
-
134
- async with extensions_runner.executing():
135
- if not execution_context.result:
136
- result = original_execute(
137
- schema,
138
- execution_context.graphql_document,
139
- root_value=execution_context.root_value,
140
- middleware=extensions_runner.as_middleware_manager(),
141
- variable_values=execution_context.variables,
142
- operation_name=execution_context.operation_name,
143
- context_value=execution_context.context,
144
- execution_context_class=execution_context_class,
145
- )
146
-
147
- if isawaitable(result):
148
- result = await cast(Awaitable["GraphQLExecutionResult"], result)
149
-
150
- result = cast("GraphQLExecutionResult", result)
151
- execution_context.result = result
152
- # Also set errors on the execution_context so that it's easier
153
- # to access in extensions
154
- if result.errors:
155
- execution_context.errors = result.errors
156
-
157
- # Run the `Schema.process_errors` function here before
158
- # extensions have a chance to modify them (see the MaskErrors
159
- # extension). That way we can log the original errors but
160
- # only return a sanitised version to the client.
161
- process_errors(result.errors, execution_context)
114
+ if execution_context.operation_type not in allowed_operation_types:
115
+ raise InvalidOperationTypeError(execution_context.operation_type)
116
+
117
+ async with extensions_runner.validation():
118
+ _run_validation(execution_context)
119
+ if execution_context.errors:
120
+ process_errors(execution_context.errors, execution_context)
121
+ return ExecutionResult(data=None, errors=execution_context.errors)
122
+
123
+ async with extensions_runner.executing():
124
+ if not execution_context.result:
125
+ result = original_execute(
126
+ schema,
127
+ execution_context.graphql_document,
128
+ root_value=execution_context.root_value,
129
+ middleware=extensions_runner.as_middleware_manager(),
130
+ variable_values=execution_context.variables,
131
+ operation_name=execution_context.operation_name,
132
+ context_value=execution_context.context,
133
+ execution_context_class=execution_context_class,
134
+ )
135
+
136
+ if isawaitable(result):
137
+ result = await cast(Awaitable["GraphQLExecutionResult"], result)
138
+
139
+ result = cast("GraphQLExecutionResult", result)
140
+ execution_context.result = result
141
+ # Also set errors on the execution_context so that it's easier
142
+ # to access in extensions
143
+ if result.errors:
144
+ execution_context.errors = result.errors
145
+
146
+ # Run the `Schema.process_errors` function here before
147
+ # extensions have a chance to modify them (see the MaskErrors
148
+ # extension). That way we can log the original errors but
149
+ # only return a sanitised version to the client.
150
+ process_errors(result.errors, execution_context)
151
+
152
+ except (MissingQueryError, InvalidOperationTypeError) as e:
153
+ raise e
154
+ except Exception as exc:
155
+ error = GraphQLError(str(exc), original_error=exc)
156
+ execution_context.errors = [error]
157
+ process_errors([error], execution_context)
158
+ return ExecutionResult(
159
+ data=None,
160
+ errors=[error],
161
+ extensions=await extensions_runner.get_extensions_results(),
162
+ )
162
163
 
163
164
  return ExecutionResult(
164
165
  data=execution_context.result.data,
@@ -181,80 +182,82 @@ def execute_sync(
181
182
  extensions=list(extensions),
182
183
  )
183
184
 
184
- with extensions_runner.operation():
185
- # Note: In graphql-core the schema would be validated here but in
186
- # Strawberry we are validating it at initialisation time instead
187
- if not execution_context.query:
188
- raise MissingQueryError()
189
-
190
- with extensions_runner.parsing():
191
- try:
192
- if not execution_context.graphql_document:
193
- execution_context.graphql_document = parse_document(
194
- execution_context.query, **execution_context.parse_options
185
+ try:
186
+ with extensions_runner.operation():
187
+ # Note: In graphql-core the schema would be validated here but in
188
+ # Strawberry we are validating it at initialisation time instead
189
+ if not execution_context.query:
190
+ raise MissingQueryError()
191
+
192
+ with extensions_runner.parsing():
193
+ try:
194
+ if not execution_context.graphql_document:
195
+ execution_context.graphql_document = parse_document(
196
+ execution_context.query, **execution_context.parse_options
197
+ )
198
+
199
+ except GraphQLError as exc:
200
+ execution_context.errors = [exc]
201
+ process_errors([exc], execution_context)
202
+ return ExecutionResult(
203
+ data=None,
204
+ errors=[exc],
205
+ extensions=extensions_runner.get_extensions_results_sync(),
195
206
  )
196
207
 
197
- except GraphQLError as error:
198
- execution_context.errors = [error]
199
- process_errors([error], execution_context)
200
- return ExecutionResult(
201
- data=None,
202
- errors=[error],
203
- extensions=extensions_runner.get_extensions_results_sync(),
204
- )
205
-
206
- except Exception as error: # pragma: no cover
207
- error = GraphQLError(str(error), original_error=error)
208
-
209
- execution_context.errors = [error]
210
- process_errors([error], execution_context)
211
- return ExecutionResult(
212
- data=None,
213
- errors=[error],
214
- extensions=extensions_runner.get_extensions_results_sync(),
215
- )
216
-
217
- if execution_context.operation_type not in allowed_operation_types:
218
- raise InvalidOperationTypeError(execution_context.operation_type)
219
-
220
- with extensions_runner.validation():
221
- _run_validation(execution_context)
222
- if execution_context.errors:
223
- process_errors(execution_context.errors, execution_context)
224
- return ExecutionResult(data=None, errors=execution_context.errors)
225
-
226
- with extensions_runner.executing():
227
- if not execution_context.result:
228
- result = original_execute(
229
- schema,
230
- execution_context.graphql_document,
231
- root_value=execution_context.root_value,
232
- middleware=extensions_runner.as_middleware_manager(),
233
- variable_values=execution_context.variables,
234
- operation_name=execution_context.operation_name,
235
- context_value=execution_context.context,
236
- execution_context_class=execution_context_class,
237
- )
238
-
239
- if isawaitable(result):
240
- result = cast(Awaitable["GraphQLExecutionResult"], result)
241
- ensure_future(result).cancel()
242
- raise RuntimeError(
243
- "GraphQL execution failed to complete synchronously."
208
+ if execution_context.operation_type not in allowed_operation_types:
209
+ raise InvalidOperationTypeError(execution_context.operation_type)
210
+
211
+ with extensions_runner.validation():
212
+ _run_validation(execution_context)
213
+ if execution_context.errors:
214
+ process_errors(execution_context.errors, execution_context)
215
+ return ExecutionResult(data=None, errors=execution_context.errors)
216
+
217
+ with extensions_runner.executing():
218
+ if not execution_context.result:
219
+ result = original_execute(
220
+ schema,
221
+ execution_context.graphql_document,
222
+ root_value=execution_context.root_value,
223
+ middleware=extensions_runner.as_middleware_manager(),
224
+ variable_values=execution_context.variables,
225
+ operation_name=execution_context.operation_name,
226
+ context_value=execution_context.context,
227
+ execution_context_class=execution_context_class,
244
228
  )
245
229
 
246
- result = cast("GraphQLExecutionResult", result)
247
- execution_context.result = result
248
- # Also set errors on the execution_context so that it's easier
249
- # to access in extensions
250
- if result.errors:
251
- execution_context.errors = result.errors
252
-
253
- # Run the `Schema.process_errors` function here before
254
- # extensions have a chance to modify them (see the MaskErrors
255
- # extension). That way we can log the original errors but
256
- # only return a sanitised version to the client.
257
- process_errors(result.errors, execution_context)
230
+ if isawaitable(result):
231
+ result = cast(Awaitable["GraphQLExecutionResult"], result)
232
+ ensure_future(result).cancel()
233
+ raise RuntimeError(
234
+ "GraphQL execution failed to complete synchronously."
235
+ )
236
+
237
+ result = cast("GraphQLExecutionResult", result)
238
+ execution_context.result = result
239
+ # Also set errors on the execution_context so that it's easier
240
+ # to access in extensions
241
+ if result.errors:
242
+ execution_context.errors = result.errors
243
+
244
+ # Run the `Schema.process_errors` function here before
245
+ # extensions have a chance to modify them (see the MaskErrors
246
+ # extension). That way we can log the original errors but
247
+ # only return a sanitised version to the client.
248
+ process_errors(result.errors, execution_context)
249
+
250
+ except (MissingQueryError, InvalidOperationTypeError) as e:
251
+ raise e
252
+ except Exception as exc:
253
+ error = GraphQLError(str(exc), original_error=exc)
254
+ execution_context.errors = [error]
255
+ process_errors([error], execution_context)
256
+ return ExecutionResult(
257
+ data=None,
258
+ errors=[error],
259
+ extensions=extensions_runner.get_extensions_results_sync(),
260
+ )
258
261
 
259
262
  return ExecutionResult(
260
263
  data=execution_context.result.data,
@@ -61,15 +61,15 @@
61
61
  <link
62
62
  crossorigin
63
63
  rel="stylesheet"
64
- href="https://unpkg.com/graphiql@3.0.9/graphiql.min.css"
64
+ href="https://unpkg.com/graphiql@3.0.5/graphiql.min.css"
65
65
  integrity="sha384-yz3/sqpuplkA7msMo0FE4ekg0xdwdvZ8JX9MVZREsxipqjU4h8IRfmAMRcb1QpUy"
66
66
  />
67
67
 
68
68
  <link
69
69
  crossorigin
70
70
  rel="stylesheet"
71
- href="https://unpkg.com/@graphiql/plugin-explorer@1.0.2/dist/style.css"
72
- integrity="sha384-5DFJlDPW2tSATRbM8kzoP1j194jexLswuNmClWoRr2Q0x7R68JIQzPHZ02Faktwi"
71
+ href="https://unpkg.com/@graphiql/plugin-explorer@0.3.4/dist/style.css"
72
+ integrity="sha384-kOrlMT58B3t0hTVIPFqWyg1oL4DKvxHNcC1X2qugv4fXd9ehKULhhjDLvBi3HoEK"
73
73
  />
74
74
  </head>
75
75
 
@@ -77,12 +77,12 @@
77
77
  <div id="graphiql" class="graphiql-container">Loading...</div>
78
78
  <script
79
79
  crossorigin
80
- src="https://unpkg.com/graphiql@3.0.9/graphiql.min.js"
81
- integrity="sha384-Mjte+vxCWz1ZYCzszGHiJqJa5eAxiqI4mc3BErq7eDXnt+UGLXSEW7+i0wmfPiji"
80
+ src="https://unpkg.com/graphiql@3.0.5/graphiql.min.js"
81
+ integrity="sha384-M+Ed4RZlnWvJ8keiTju1xlV6xM5tB9tLTfoSdWPDVrK4aOOpavtruK9pz/dfuCZ/"
82
82
  ></script>
83
83
  <script
84
84
  crossorigin
85
- src="https://unpkg.com/@graphiql/plugin-explorer@1.0.2/dist/index.umd.js"
85
+ src="https://unpkg.com/@graphiql/plugin-explorer@0.3.4/dist/index.umd.js"
86
86
  integrity="sha384-2oonKe47vfHIZnmB6ZZ10vl7T0Y+qrHQF2cmNTaFDuPshpKqpUMGMc9jgj9MLDZ9"
87
87
  ></script>
88
88
  <script>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: strawberry-graphql
3
- Version: 0.214.0
3
+ Version: 0.214.0.dev1701082152
4
4
  Summary: A library for creating GraphQL APIs
5
5
  Home-page: https://strawberry.rocks/
6
6
  License: MIT
@@ -17,7 +17,7 @@ strawberry/asgi/test/__init__.py,sha256=4xxdUZtIISSOwjrcnmox7AvT4WWjowCm5bUuPdQn
17
17
  strawberry/asgi/test/client.py,sha256=pqxTfWdA8N0Te4pRGxC8TiRcND43LadX-TRo1O_1JJY,1407
18
18
  strawberry/auto.py,sha256=aQixog3ZPFqL_o1YYRhYbURUntoOY0UAGzLxT-Wiwi8,2589
19
19
  strawberry/chalice/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- strawberry/chalice/views.py,sha256=YcXPPZfpLPIqUZXFTPwK6aFOPN4Ef-FLZNHCY1qrZQM,4476
20
+ strawberry/chalice/views.py,sha256=sqAKBMGjByPkgLS69-HxHZHznro0iOUErF4s5t4bfps,4492
21
21
  strawberry/channels/__init__.py,sha256=9oRdAT7uIYETF-23gZ5NteOXSjwkUtwRmwu3YCFv1tw,671
22
22
  strawberry/channels/handlers/base.py,sha256=tgXLjKCHrP-8yOJV-qo9iOMJUgDe2wW6rGs_nDZFi80,7869
23
23
  strawberry/channels/handlers/graphql_transport_ws_handler.py,sha256=UKfxRoo1pEv1CBHhkhSTkbztJlfU-OoksFwyLktj8xc,1945
@@ -46,7 +46,7 @@ strawberry/codegen/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
46
46
  strawberry/codegen/plugins/print_operation.py,sha256=aw2o-41nZSZ2eOHPyp58-45QsAgUs1MmnHDIQzQRg9M,6805
47
47
  strawberry/codegen/plugins/python.py,sha256=aellTnJAZOfTZqFXH4fEGYFjnnCucyroeOXo9D0QkrA,6924
48
48
  strawberry/codegen/plugins/typescript.py,sha256=f3JJ0FGuhycu-bxOkW7KxAyYdfmcbej-lueOJZx3V7Y,3783
49
- strawberry/codegen/query_codegen.py,sha256=ESdUG2i7HaU3R8vrdYwBlLD-2FUeLi2wKIIG3jnTXWc,30241
49
+ strawberry/codegen/query_codegen.py,sha256=8SuAjfQFV8Ypw6p7TQrIIls8cSVOTv4CpEb1s1F_5Ag,30263
50
50
  strawberry/codegen/types.py,sha256=7q3pJAHADYsEyQ47d16txJUYFVpaMR_bs6qZp2_eAjk,3486
51
51
  strawberry/codemods/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  strawberry/codemods/annotated_unions.py,sha256=TStU8ye5J1---P5mNWXBGeQa8m_J7FyPU_MYjzDZ-RU,5910
@@ -181,7 +181,7 @@ strawberry/schema/base.py,sha256=lQBJyzG2ZhKc544oLbXEbpYOPOjaXBop3lxp68h_lfI,297
181
181
  strawberry/schema/compat.py,sha256=n0r3UPUcGemMqK8vklgtCkkuCA1p6tWAYbc6Vl4iNOw,1684
182
182
  strawberry/schema/config.py,sha256=N9KsqkSTnm5snizoBZAVneaWQprhaTd8PFyMuR-jfUs,632
183
183
  strawberry/schema/exceptions.py,sha256=_9Ua-lLRCJfbtd8B6MXILNKGI2SwHkcBNkAHYM7ITp8,534
184
- strawberry/schema/execute.py,sha256=MAfuE2o89qBmnBpgaTmUA9xJ682KvEQw52EOh4XVE00,10415
184
+ strawberry/schema/execute.py,sha256=aqLZkqb_cK2OVxfkagP6hS9_XADTpRIkY8I5J75ZhHY,10802
185
185
  strawberry/schema/name_converter.py,sha256=UdNyd-QtqF2HsDCQK-nsOcLGxDTj4hJwYFNvMtZnpq4,6533
186
186
  strawberry/schema/schema.py,sha256=0FlMPIeMwRo2OEUG9lD-OmMFbnpKDACZgBNaCoTVxok,13187
187
187
  strawberry/schema/schema_converter.py,sha256=pxUgK5VEI2Puc_zk2lwDPknb3rg-SuFOManl4fSDZ9s,35601
@@ -196,7 +196,7 @@ strawberry/starlite/controller.py,sha256=x6Mm3r36cRfzo6hz9B4AYWbVh2QlYtndYcXFOr_
196
196
  strawberry/starlite/handlers/graphql_transport_ws_handler.py,sha256=LtYEMmm5Mf93f_DoH_2yELt0Qr3aey3sJkR6eAqkYSE,1973
197
197
  strawberry/starlite/handlers/graphql_ws_handler.py,sha256=1KQCa8yPajdSFnBebbVWL15vJRcQQdHuNKTgIyTJN0g,2215
198
198
  strawberry/static/apollo-sandbox.html,sha256=Rb8LN2D7eB1fg_g5aKkqQPqheuS3ocMTuSC2MjsO67A,940
199
- strawberry/static/graphiql.html,sha256=r1JCF4vpptjISOAHaCrgck2b3qf0oaCEzljECWQ7aCE,4380
199
+ strawberry/static/graphiql.html,sha256=qL86oan5HksZmRYJG_7H9w1NcidHaz5Hj99g2Uo5xvY,4380
200
200
  strawberry/static/pathfinder.html,sha256=0DPx9AmJ2C_sJstFXnWOz9k5tVQHeHaK7qdVY4lAlmk,1547
201
201
  strawberry/subscriptions/__init__.py,sha256=AkrFEgvz8T2JL6rxh_kHg9j61C8S3Pm7Q0XbWgLsqKM,90
202
202
  strawberry/subscriptions/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -236,8 +236,8 @@ strawberry/utils/logging.py,sha256=flS7hV0JiIOEdXcrIjda4WyIWix86cpHHFNJL8gl1y4,7
236
236
  strawberry/utils/operation.py,sha256=Um-tBCPl3_bVFN2Ph7o1mnrxfxBes4HFCj6T0x4kZxE,1135
237
237
  strawberry/utils/str_converters.py,sha256=avIgPVLg98vZH9mA2lhzVdyyjqzLsK2NdBw9mJQ02Xk,813
238
238
  strawberry/utils/typing.py,sha256=xkRDUaSJH669jtmdUvWIqrj66Vx4tsbrXSuuYy0FPxU,13490
239
- strawberry_graphql-0.214.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
240
- strawberry_graphql-0.214.0.dist-info/METADATA,sha256=P95_LdC8Eaq6dDOVK6MSnEZ0SgUuaaW55AYFOOXMyhA,7641
241
- strawberry_graphql-0.214.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
242
- strawberry_graphql-0.214.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
243
- strawberry_graphql-0.214.0.dist-info/RECORD,,
239
+ strawberry_graphql-0.214.0.dev1701082152.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
240
+ strawberry_graphql-0.214.0.dev1701082152.dist-info/METADATA,sha256=bfOftMog_QTzzrbp_oDGaFKUGNu3gfcXACVRL4efgdg,7655
241
+ strawberry_graphql-0.214.0.dev1701082152.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
242
+ strawberry_graphql-0.214.0.dev1701082152.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
243
+ strawberry_graphql-0.214.0.dev1701082152.dist-info/RECORD,,