add 🍓
This commit is contained in:
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
22
src/api/graphql/__init__.py
Normal file
22
src/api/graphql/__init__.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import strawberry
|
||||||
|
|
||||||
|
from fastapi import FastAPI
|
||||||
|
from strawberry.fastapi import GraphQLRouter
|
||||||
|
|
||||||
|
from src.common.server import global_server
|
||||||
|
|
||||||
|
|
||||||
|
@strawberry.type
|
||||||
|
class Query:
|
||||||
|
@strawberry.field
|
||||||
|
def hello(self) -> str:
|
||||||
|
return "Hello World"
|
||||||
|
|
||||||
|
|
||||||
|
schema = strawberry.Schema(Query)
|
||||||
|
|
||||||
|
graphql_app = GraphQLRouter(schema)
|
||||||
|
|
||||||
|
fast_api_app: FastAPI = global_server.get_app()
|
||||||
|
|
||||||
|
fast_api_app.include_router(graphql_app, prefix="/graphql")
|
||||||
1
src/api/graphql/schema.py
Normal file
1
src/api/graphql/schema.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pass
|
||||||
Reference in New Issue
Block a user