Skip to content

Commit

Permalink
Remove subresponse
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick91 committed Jan 26, 2024
1 parent b15b5ac commit 4935201
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 11 deletions.
1 change: 1 addition & 0 deletions docs/general/multipart-subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ libraries:
- Litestar
- FastAPI
- AioHTTP
- Quart

# Usage

Expand Down
2 changes: 0 additions & 2 deletions strawberry/aiohttp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@ async def create_multipart_response(
self,
request: web.Request,
stream: Callable[[], AsyncGenerator[str, None]],
sub_response: web.Response,
) -> web.StreamResponse:
# TODO: use sub response
response = web.StreamResponse(
status=200,
headers={
Expand Down
1 change: 0 additions & 1 deletion strawberry/asgi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ async def create_multipart_response(
self,
request: Request,
stream: Callable[[], AsyncIterator[str]],
sub_response: Response,
) -> Response:
return StreamingResponse(
stream(),
Expand Down
1 change: 0 additions & 1 deletion strawberry/channels/handlers/http_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ async def create_multipart_response(
self,
request: ChannelsRequest,
stream: Callable[[], AsyncGenerator[str, None]],
sub_response: TemporalResponse,
) -> MultipartChannelsResponse:
# TODO: sub response
return MultipartChannelsResponse(stream=stream)
Expand Down
1 change: 0 additions & 1 deletion strawberry/django/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ async def create_multipart_response(
self,
request: HttpRequest,
stream: Callable[[], AsyncIterator[Any]],
sub_response: HttpResponse,
) -> HttpResponseBase:
return StreamingHttpResponse(
streaming_content=stream(),
Expand Down
1 change: 0 additions & 1 deletion strawberry/fastapi/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ async def create_multipart_response(
self,
request: Request,
stream: Callable[[], AsyncIterator[str]],
sub_response: Response,
) -> Response:
return StreamingResponse(
stream(),
Expand Down
3 changes: 1 addition & 2 deletions strawberry/http/async_base_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ async def create_multipart_response(
self,
request: Request,
stream: Callable[[], AsyncGenerator[str, None]],
sub_response: SubResponse,
) -> Response:
raise ValueError("Multipart responses are not supported")

Expand Down Expand Up @@ -213,7 +212,7 @@ async def run(
if isinstance(result, SubscriptionExecutionResult):
stream = self._get_stream(request, result)

return await self.create_multipart_response(request, stream, sub_response)
return await self.create_multipart_response(request, stream)

response_data = await self.process_result(request=request, result=result)

Expand Down
1 change: 0 additions & 1 deletion strawberry/litestar/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ async def create_multipart_response(
self,
request: Request,
stream: Callable[[], AsyncIterator[str]],
sub_response: Response,
) -> Response:
return Stream(
stream(),
Expand Down
1 change: 0 additions & 1 deletion strawberry/quart/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ async def create_multipart_response(
self,
request: Request,
stream: Callable[[], AsyncGenerator[str, None]],
sub_response: Response,
) -> Response:
return (
stream(),
Expand Down
1 change: 0 additions & 1 deletion strawberry/sanic/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ async def create_multipart_response(
self,
request: Request,
stream: Callable[[], AsyncGenerator[str, None]],
sub_response: TemporalResponse,
) -> HTTPResponse:
response = await self.request.respond(
content_type="multipart/mixed;boundary=graphql;subscriptionSpec=1.0,application/json",
Expand Down

0 comments on commit 4935201

Please sign in to comment.