from app.schema import schema
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from starlette.graphql import GraphQLApp

api = FastAPI()

origins = [
    "http://localhost:3000",
    "*",  # HACK
]

api.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

api.add_route("/graphql", GraphQLApp(schema=schema))


@api.get("/")
def read_root():
    return {"Hello": "World"}

9ae62cb9edcfcb9b8e36b8416ede7282d0014259
<mask token>


@api.get('/')
def read_root():
    return {'Hello': 'World'}

<mask token>
api.add_middleware(CORSMiddleware, allow_origins=origins, allow_credentials
    =True, allow_methods=['*'], allow_headers=['*'])
api.add_route('/graphql', GraphQLApp(schema=schema))


@api.get('/')
def read_root():
    return {'Hello': 'World'}

<mask token>
api = FastAPI()
origins = ['http://localhost:3000', '*']
api.add_middleware(CORSMiddleware, allow_origins=origins, allow_credentials
    =True, allow_methods=['*'], allow_headers=['*'])
api.add_route('/graphql', GraphQLApp(schema=schema))


@api.get('/')
def read_root():
    return {'Hello': 'World'}

from app.schema import schema
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from starlette.graphql import GraphQLApp
api = FastAPI()
origins = ['http://localhost:3000', '*']
api.add_middleware(CORSMiddleware, allow_origins=origins, allow_credentials
    =True, allow_methods=['*'], allow_headers=['*'])
api.add_route('/graphql', GraphQLApp(schema=schema))


@api.get('/')
def read_root():
    return {'Hello': 'World'}

from app.schema import schema
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from starlette.graphql import GraphQLApp

api = FastAPI()

origins = [
    "http://localhost:3000",
    "*",  # HACK
]

api.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

api.add_route("/graphql", GraphQLApp(schema=schema))


@api.get("/")
def read_root():
    return {"Hello": "World"}
