26
loading...
This website collects cookies to deliver better user experience
type Author {
id:ID!
age: 56
genre: "horror"
american: True
books: [Books]
symbol: ✍️
}
type Books{
language: String!
number: int
author: Author
symbol: 📚
}
import graphene
from fastapi import FastAPI
from starlette.graphql import GraphQLApp
class Query(graphene.ObjectType):
hello = graphene.String(name=graphene.String(default_value=", world 🌎 !"))
def resolve_hello(self, info, name):
return "Hello " + name
app = FastAPI()
app.add_route("/", GraphQLApp(schema=graphene.Schema(query=Query)))