pythonasyncioapiasyncfastapiframeworkjsonjson-schemaopenapiopenapi3pydanticpython-typespython3redocreststarletteswaggerswagger-uiuvicornweb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
356 B
14 lines
356 B
import graphene
|
|
from fastapi import FastAPI
|
|
from starlette.graphql import GraphQLApp
|
|
|
|
|
|
class Query(graphene.ObjectType):
|
|
hello = graphene.String(name=graphene.String(default_value="stranger"))
|
|
|
|
def resolve_hello(self, info, name):
|
|
return "Hello " + name
|
|
|
|
|
|
app = FastAPI()
|
|
app.add_route("/", GraphQLApp(schema=graphene.Schema(query=Query)))
|
|
|