Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use explicit response code to avoid type error #3666

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading