diff --git a/main.py b/main.py index 488ad9dc..727e3d63 100644 --- a/main.py +++ b/main.py @@ -2,23 +2,19 @@ import os from importlib import import_module from os.path import exists -from ariadne import load_schema_from_path, make_executable_schema from ariadne.asgi import GraphQL from starlette.applications import Starlette from starlette.routing import Route from services.rediscache import redis -from services.schema import resolvers +from services.schema import schema from services.search import search_service from services.sentry import start_sentry from services.viewed import ViewedStorage from services.webhook import WebhookEndpoint from settings import DEV_SERVER_PID_FILE_NAME, MODE - import_module('resolvers') -schema = make_executable_schema(load_schema_from_path('schema/'), resolvers) - async def start(): if MODE == 'development': diff --git a/services/schema.py b/services/schema.py index 32fb1525..52516f4d 100644 --- a/services/schema.py +++ b/services/schema.py @@ -1,5 +1,8 @@ from ariadne import MutationType, QueryType +from ariadne import load_schema_from_path, make_executable_schema query = QueryType() mutation = MutationType() resolvers = [query, mutation] + +schema = make_executable_schema(load_schema_from_path('schema/'), resolvers)