Skip to content
Advertisement

Tag: strawberry-graphql

Strawberry+FastAPI: How to get request-info in a dependency?

Consider this code: How do I get the request info in the dependencies custom_context_dependency and has_root_access? Answer When I tried FastAPI’s Request, it was still showing some error when Strawberry’s page was opened. Later I understood that the error was being raised by WebSocket connection. So my solution was to make request and web-socket optional params: Either request or websocket

Advertisement