-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Closed
Labels
Description
First Check
- I added a very descriptive title to this issue.
- I used the GitHub search to find a similar issue and didn't find it.
- I searched the FastAPI documentation, with the integrated search.
- I already searched in Google "How to X in FastAPI" and didn't find any information.
- I already read and followed all the tutorial in the docs and didn't find an answer.
- I already checked if it is not related to FastAPI but to Pydantic.
- I already checked if it is not related to FastAPI but to Swagger UI.
- I already checked if it is not related to FastAPI but to ReDoc.
Commit to Help
- I commit to help with one of those options 👆
Example Code
from fastapi import APIRouter, Depends, HTTPException
from strawberry.asgi import GraphQL
from . import graphql_schema
def some_func():
print("CALLED")
raise HTTPException(status_code=400, detail="X-Token header invalid")
print("HERE")
router = APIRouter(dependencies=[Depends(some_func)])
graphql = GraphQL(graphql_schema)
router.add_route("/", graphql)Description
Accessing a route added with add_route does not invoke the dependencies - it never actually executes some_func (I never see the CALLED print statement in logs)
Operating System
macOS
Operating System Details
No response
FastAPI Version
0.65.2
Python Version
3.9.5
Additional Context
No response
vbhakta8 and four43Kludex, vbhakta8 and mkanoria