-
-
Notifications
You must be signed in to change notification settings - Fork 536
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
Add flask async view #1907
Add flask async view #1907
Conversation
for more information, see https://pre-commit.ci
Thanks for adding the Here's a preview of the changelog: This release adds a new flask view to allow for aysnc dispatching of requests. This is especially useful when using dataloaders with flask. from strawberry.flask.views import AsyncGraphQLView
...
app.add_url_rule("/graphql", view_func=AsyncGraphQLView.as_view("graphql_view", schema=schema, **kwargs)) Here's the preview release card for twitter: Here's the tweet text:
|
Codecov Report
@@ Coverage Diff @@
## main #1907 +/- ##
==========================================
- Coverage 98.17% 98.04% -0.14%
==========================================
Files 143 143
Lines 5530 5562 +32
Branches 1017 1023 +6
==========================================
+ Hits 5429 5453 +24
- Misses 50 56 +6
- Partials 51 53 +2 |
…strawberry into feat/add-flask-async-view
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good! Can you add some docs here? https://strawberry.rocks/docs/integrations/flask
then it will be ready to merge 😊
@patrick91 Added a few more tests to get that coverage up and also added the docs. Thank you for making this an enjoyable process to contribute back. Looking forward to making more contributions down the line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR! I added a couple of comments :)
Co-authored-by: Etty <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I took the liberty of applying @estyxx suggestions 😊 will merge in a bit :)
Thanks for contributing to Strawberry! 🎉 You've been invited to join You can also request a free sticker by filling this form: https://forms.gle/dmnfQUPoY5gZbVT67 And don't forget to join our discord server: https://strawberry.rocks/discord 🔥 |
Thanks all! |
Description
MR to address issue #1903
Adds a new async-enabled view for use with Flask. This is specifically helpful when using async dataloaders to handle n+1 cases in your schema
Types of Changes
Issues Fixed or Closed by This PR
#1903
Checklist