strawberry-graphql 0.240.3.dev1726159932__py3-none-any.whl → 0.240.4__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.
@@ -123,18 +123,14 @@ async def _handle_execution_result(
123
123
  context: ExecutionContext,
124
124
  result: Union[GraphQLExecutionResult, ExecutionResult],
125
125
  extensions_runner: SchemaExtensionsRunner,
126
- process_errors: ProcessErrors,
126
+ process_errors: ProcessErrors | None,
127
127
  ) -> ExecutionResult:
128
128
  # Set errors on the context so that it's easier
129
129
  # to access in extensions
130
130
  if result.errors:
131
131
  context.errors = result.errors
132
-
133
- # Run the `Schema.process_errors` function here before
134
- # extensions have a chance to modify them (see the MaskErrors
135
- # extension). That way we can log the original errors but
136
- # only return a sanitised version to the client.
137
- process_errors(result.errors, context)
132
+ if process_errors:
133
+ process_errors(result.errors, context)
138
134
  if isinstance(result, GraphQLExecutionResult):
139
135
  result = ExecutionResult(data=result.data, errors=result.errors)
140
136
  result.extensions = await extensions_runner.get_extensions_results(context)
@@ -171,7 +167,7 @@ async def execute(
171
167
  assert execution_context.graphql_document
172
168
  async with extensions_runner.executing():
173
169
  if not execution_context.result:
174
- res = await await_maybe(
170
+ result = await await_maybe(
175
171
  original_execute(
176
172
  schema,
177
173
  execution_context.graphql_document,
@@ -183,9 +179,20 @@ async def execute(
183
179
  execution_context_class=execution_context_class,
184
180
  )
185
181
  )
186
-
182
+ execution_context.result = result
187
183
  else:
188
- res = execution_context.result
184
+ result = execution_context.result
185
+ # Also set errors on the execution_context so that it's easier
186
+ # to access in extensions
187
+ if result.errors:
188
+ execution_context.errors = result.errors
189
+
190
+ # Run the `Schema.process_errors` function here before
191
+ # extensions have a chance to modify them (see the MaskErrors
192
+ # extension). That way we can log the original errors but
193
+ # only return a sanitised version to the client.
194
+ process_errors(result.errors, execution_context)
195
+
189
196
  except (MissingQueryError, InvalidOperationTypeError) as e:
190
197
  raise e
191
198
  except Exception as exc:
@@ -195,10 +202,9 @@ async def execute(
195
202
  extensions_runner,
196
203
  process_errors,
197
204
  )
198
-
199
205
  # return results after all the operation completed.
200
206
  return await _handle_execution_result(
201
- execution_context, res, extensions_runner, process_errors
207
+ execution_context, result, extensions_runner, None
202
208
  )
203
209
 
204
210
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: strawberry-graphql
3
- Version: 0.240.3.dev1726159932
3
+ Version: 0.240.4
4
4
  Summary: A library for creating GraphQL APIs
5
5
  Home-page: https://strawberry.rocks/
6
6
  License: MIT
@@ -182,7 +182,7 @@ strawberry/schema/base.py,sha256=yarj62fhfCp0kToJPpWlNcCjyZV2CafbfpZ-yamjNVg,373
182
182
  strawberry/schema/compat.py,sha256=rRqUm5-XgPXC018_u0Mrd4iad7tTRCNA45Ko4NaT6gk,1836
183
183
  strawberry/schema/config.py,sha256=Aa01oqnHb0ZPlw8Ti_O840LxlT827LNio15BQrc37A0,717
184
184
  strawberry/schema/exceptions.py,sha256=rqVNb_oYrKM0dHPgvAemqCG6Um282LPPu4zwQ5cZqs4,584
185
- strawberry/schema/execute.py,sha256=XbArky5xmCWo_r2ootm8WREzzzZ0SsU9FoyfxA6Vc8g,11490
185
+ strawberry/schema/execute.py,sha256=EWNmu3hvlZMV2EWi8IbWVLUQYRH45AFB68DrOnx3BEI,11913
186
186
  strawberry/schema/name_converter.py,sha256=tpqw2XCSFvJI-H844iWhE2Z1sKic7DrjIZxt11eJN5Y,6574
187
187
  strawberry/schema/schema.py,sha256=rdsZrnAZZDV_eU_9s2K21hgROtP29GRt5MjUrwVBwyE,19034
188
188
  strawberry/schema/schema_converter.py,sha256=lckL2LoxAb6mNfJIVcerht2buzBG573ly3BHyl7wra4,36859
@@ -245,8 +245,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
245
245
  strawberry/utils/operation.py,sha256=SSXxN-vMqdHO6W2OZtip-1z7y4_A-eTVFdhDvhKeLCk,1193
246
246
  strawberry/utils/str_converters.py,sha256=KGd7QH90RevaJjH6SQEkiVVsb8KuhJr_wv5AsI7UzQk,897
247
247
  strawberry/utils/typing.py,sha256=3xws5kxSQGsp8BnYyUwClvxXNzZakMAuOPoq1rjHRuk,14252
248
- strawberry_graphql-0.240.3.dev1726159932.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
249
- strawberry_graphql-0.240.3.dev1726159932.dist-info/METADATA,sha256=OGhqrqrIWMS0ConpfeIpGizFZUl2KdeUMOC9aGvdEIg,7721
250
- strawberry_graphql-0.240.3.dev1726159932.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
251
- strawberry_graphql-0.240.3.dev1726159932.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
252
- strawberry_graphql-0.240.3.dev1726159932.dist-info/RECORD,,
248
+ strawberry_graphql-0.240.4.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
249
+ strawberry_graphql-0.240.4.dist-info/METADATA,sha256=IqNDPmQaZcnr9BSSjGRay-Vkj85ebNZzgKTK6XqQl9I,7707
250
+ strawberry_graphql-0.240.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
251
+ strawberry_graphql-0.240.4.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
252
+ strawberry_graphql-0.240.4.dist-info/RECORD,,