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

Fail to launch server for fastapi == 0.89.0 #2439

Closed
yuyupopo opened this issue Jan 9, 2023 · 2 comments
Closed

Fail to launch server for fastapi == 0.89.0 #2439

yuyupopo opened this issue Jan 9, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@yuyupopo
Copy link

yuyupopo commented Jan 9, 2023

Using GraphQLRouter for fastapi version 0.89.0 fails.
This is due to tiangolo/fastapi#5857 .

Describe the Bug

In fastapi 0.89.0, it automatically parses response_class from the router function return type (tiangolo/fastapi#1436).
However, fastapi has a bug (tiangolo/fastapi#5857) which it cannot accept starlette.responses.* classes when it should.

Strawberry-graphql's

line defines starlette.responses.Response as return type. Therefore an error is raised.

Maybe remove the return type for now?

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@yuyupopo yuyupopo added the bug Something isn't working label Jan 9, 2023
@patrick91
Copy link
Member

@yuyupopo this is a but in FastAPI, but we released a workaround, should be ok for now!

@tiangolo
Copy link

tiangolo commented Feb 6, 2023

BTW, there was a fix and a release in FastAPI to have special handling when the type annotation is a Response, to avoid all the Pydantic validation, etc. So this should now work normally without problems. You probably already noticed, but as I just saw this issue linked from the original PR I wanted to come and comment that here. 🤓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants