Skip to content

Commit

Permalink
Use explicit response code to avoid type error
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorJohn committed Oct 12, 2024
1 parent daec236 commit f2bc322
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Release type: patch

This release tweaks the Flask integration's `render_graphql_ide` method to be stricter typed internally, making type checkers ever so slightly happier.
3 changes: 2 additions & 1 deletion strawberry/flask/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ async def dispatch_request(self) -> ResponseReturnValue: # type: ignore
)

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

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

0 comments on commit f2bc322

Please sign in to comment.