executor abstraction, graphene to strawberry
This commit is contained in:
@@ -21,7 +21,7 @@ django.setup()
|
||||
|
||||
from fastapi import FastAPI, Header, HTTPException
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from starlette_graphene3 import GraphQLApp, make_graphiql_handler
|
||||
from strawberry.fastapi import GraphQLRouter
|
||||
|
||||
from api.graphql import schema as graphql_schema
|
||||
|
||||
@@ -45,7 +45,8 @@ app.add_middleware(
|
||||
)
|
||||
|
||||
# GraphQL
|
||||
app.mount("/graphql", GraphQLApp(schema=graphql_schema, on_get=make_graphiql_handler()))
|
||||
graphql_router = GraphQLRouter(schema=graphql_schema, graphql_ide="graphiql")
|
||||
app.include_router(graphql_router, prefix="/graphql")
|
||||
|
||||
|
||||
@app.get("/")
|
||||
|
||||
Reference in New Issue
Block a user