mirror of
https://github.com/fastapi/fastapi.git
synced 2026-10-19 08:31:35 -04:00
✏️ Update Strawberry integration docs (#13155)
This commit is contained in:
1 parent
6e60d0a056
commit
b0e70cb37e
2 files changed
+4
-5
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import strawberry
|
||||
from fastapi import FastAPI
|
||||
from strawberry.asgi import GraphQL
|
||||
from strawberry.fastapi import GraphQLRouter
|
||||
|
||||
|
||||
@strawberry.type
|
||||
@@ -19,8 +19,7 @@ class Query:
|
||||
schema = strawberry.Schema(query=Query)
|
||||
|
||||
|
||||
graphql_app = GraphQL(schema)
|
||||
graphql_app = GraphQLRouter(schema)
|
||||
|
||||
app = FastAPI()
|
||||
app.add_route("/graphql", graphql_app)
|
||||
app.add_websocket_route("/graphql", graphql_app)
|
||||
app.include_router(graphql_app, prefix="/graphql")
|
||||
Reference in new issue
Block a user