feat: with sdl resolver in schema.py

This commit is contained in:
Stepan Vladovskiy 2023-12-01 22:56:50 -03:00
parent 1a19264bb0
commit 2338eb1fe4
2 changed files with 13 additions and 2 deletions

View File

@ -2,4 +2,15 @@ from ariadne import QueryType, MutationType
query = QueryType()
mutation = MutationType()
# duffok was here 2023-12-1
# This is a query resolver for Apollo Federation
@query.field("_service")
def resolve_service(*_):
# Load the full SDL from your SDL file
with open("inbox.graphql", "r") as file:
full_sdl = file.read()
return {"sdl": full_sdl}
resolvers = [query, mutation]

View File

@ -2,8 +2,8 @@ from os import environ
PORT = 80
REDIS_URL = environ.get("REDIS_URL") or "redis://127.0.0.1"
API_BASE = environ.get("API_BASE") or ""
AUTH_URL = environ.get("AUTH_URL") or ""
API_BASE = environ.get("API_BASE") or "https://v2.discours.io/"
AUTH_URL = environ.get("AUTH_URL") or "https://v2.discours.io/"
MODE = environ.get("MODE") or "production"
SENTRY_DSN = environ.get("SENTRY_DSN")
DEV_SERVER_PID_FILE_NAME = "dev-server.pid"