Skip to content

add_route types missing one use case #2635

Discussion options

You must be logged in to vote

@Kludex mmh, not sure I follow, do we need to change our implementation? 😊

I don't think so... But on the docs, you can just have the "mount" as follows:

from starlette.applications import Starlette
from strawberry.asgi import GraphQL

from api import schema

graphql_app = GraphQL[None, None](schema)

app = Starlette()
app.mount("/graphql", graphql_app)

Or even better:

from starlette.applications import Starlette
from starlette.routing import Mount
from strawberry.asgi import GraphQL

from api import schema

graphql_app = GraphQL[None, None](schema)

app = Starlette(routes=[Mount("/graphql", graphql_app)])

Replies: 1 comment 2 replies

Comment options

Kludex
Jul 4, 2024
Maintainer Sponsor

You must be logged in to vote
2 replies
@patrick91
Comment options

@Kludex
Comment options

Kludex Jul 5, 2024
Maintainer Sponsor

Answer selected by Kludex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants