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 support for using FastAPI APIRouter arguments in GraphQLRouter #3442
Conversation
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.
Hey @nparamonov - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 3 issues found
- 🟢 Complexity: all looks good
- 🟢 Docstrings: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
Thanks for adding the Here's a preview of the changelog: This release adds support for using FastAPI APIRouter arguments in GraphQLRouter. Now you have the opportunity to specify parameters such as import strawberry
from fastapi import FastAPI
from strawberry.fastapi import GraphQLRouter
@strawberry.type
class Query:
@strawberry.field
def hello(self) -> str:
return "Hello World"
schema = strawberry.Schema(Query)
graphql_app = GraphQLRouter(schema, tags=["graphql"])
app = FastAPI()
app.include_router(graphql_app, prefix="/graphql") Here's the tweet text:
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3442 +/- ##
=======================================
Coverage 96.48% 96.48%
=======================================
Files 509 509
Lines 32705 32717 +12
Branches 5404 5404
=======================================
+ Hits 31554 31566 +12
Misses 940 940
Partials 211 211 |
CodSpeed Performance ReportMerging #3442 will degrade performances by 29.07%Comparing Summary
Benchmarks breakdown
|
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.
Awesome! Thanks 😊
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 🔥 |
Description
Add the ability to pass additional arguments to the APIRouter via kwargs for flexibility.
Types of Changes
Issues Fixed or Closed by This PR
Checklist