|
71 | 71 | is_object_type, |
72 | 72 | ) |
73 | 73 | from .collect_fields import FieldsAndPatches, collect_fields, collect_subfields |
74 | | -from .flatten_async_iterable import flatten_async_iterable |
75 | | -from .map_async_iterable import MapAsyncIterable |
| 74 | +from .iterators import flatten_async_iterable, map_async_iterable |
76 | 75 | from .middleware import MiddlewareManager |
77 | 76 | from .values import get_argument_values, get_directive_values, get_variable_values |
78 | 77 |
|
@@ -1650,7 +1649,7 @@ async def callback(payload: Any) -> AsyncGenerator: |
1650 | 1649 | await result if isawaitable(result) else result # type: ignore |
1651 | 1650 | ) |
1652 | 1651 |
|
1653 | | - return flatten_async_iterable(MapAsyncIterable(result_or_stream, callback)) |
| 1652 | + return flatten_async_iterable(map_async_iterable(result_or_stream, callback)) |
1654 | 1653 |
|
1655 | 1654 | def execute_deferred_fragment( |
1656 | 1655 | self, |
@@ -2350,18 +2349,20 @@ def subscribe( |
2350 | 2349 | if isinstance(result, ExecutionResult): |
2351 | 2350 | return result |
2352 | 2351 | if isinstance(result, AsyncIterable): |
2353 | | - return MapAsyncIterable(result, ensure_single_execution_result) |
| 2352 | + return map_async_iterable(result, ensure_single_execution_result) |
2354 | 2353 |
|
2355 | 2354 | async def await_result() -> Union[AsyncIterator[ExecutionResult], ExecutionResult]: |
2356 | 2355 | result_or_iterable = await result # type: ignore |
2357 | 2356 | if isinstance(result_or_iterable, AsyncIterable): |
2358 | | - return MapAsyncIterable(result_or_iterable, ensure_single_execution_result) |
| 2357 | + return map_async_iterable( |
| 2358 | + result_or_iterable, ensure_single_execution_result |
| 2359 | + ) |
2359 | 2360 | return result_or_iterable |
2360 | 2361 |
|
2361 | 2362 | return await_result() |
2362 | 2363 |
|
2363 | 2364 |
|
2364 | | -def ensure_single_execution_result( |
| 2365 | +async def ensure_single_execution_result( |
2365 | 2366 | result: Union[ |
2366 | 2367 | ExecutionResult, |
2367 | 2368 | InitialIncrementalExecutionResult, |
|
0 commit comments