From 0301d8041d3a9d05cb4697f1594892cbfc6fb727 Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 19 Feb 2024 11:20:13 +0300 Subject: [PATCH] schema-move-test --- main.py | 6 +----- services/schema.py | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) 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)