Skip to content

Commit 153da5e

Browse files
authored
Use explicit response code to avoid type error (#3666)
1 parent daec236 commit 153da5e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

RELEASE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Release type: patch
2+
3+
This release tweaks the Flask integration's `render_graphql_ide` method to be stricter typed internally, making type checkers ever so slightly happier.

strawberry/flask/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ async def dispatch_request(self) -> ResponseReturnValue: # type: ignore
187187
)
188188

189189
async def render_graphql_ide(self, request: Request) -> Response:
190-
return render_template_string(self.graphql_ide_html) # type: ignore
190+
content = render_template_string(self.graphql_ide_html)
191+
return Response(content, status=200, content_type="text/html")
191192

192193
def is_websocket_request(self, request: Request) -> TypeGuard[Request]:
193194
return False

0 commit comments

Comments
 (0)