This commit is contained in:
parent
7b8e9fbea6
commit
e6720ccaaf
15
main.py
15
main.py
|
@ -19,13 +19,13 @@ from settings import DEV_SERVER_PID_FILE_NAME, MODE
|
||||||
import_module('resolvers')
|
import_module('resolvers')
|
||||||
schema = make_executable_schema(load_schema_from_path('schema/'), resolvers)
|
schema = make_executable_schema(load_schema_from_path('schema/'), resolvers)
|
||||||
|
|
||||||
start_sentry()
|
|
||||||
|
|
||||||
async def dev_pid():
|
async def start():
|
||||||
# pid file management
|
if MODE == 'development':
|
||||||
if MODE == 'development' and not exists(DEV_SERVER_PID_FILE_NAME):
|
if not exists(DEV_SERVER_PID_FILE_NAME):
|
||||||
with open(DEV_SERVER_PID_FILE_NAME, 'w', encoding='utf-8') as f:
|
# pid file management
|
||||||
f.write(str(os.getpid()))
|
with open(DEV_SERVER_PID_FILE_NAME, 'w', encoding='utf-8') as f:
|
||||||
|
f.write(str(os.getpid()))
|
||||||
print(f'[main] process started in {MODE} mode')
|
print(f'[main] process started in {MODE} mode')
|
||||||
|
|
||||||
# main starlette app object with ariadne mounted in root
|
# main starlette app object with ariadne mounted in root
|
||||||
|
@ -38,7 +38,8 @@ app = Starlette(
|
||||||
redis.connect,
|
redis.connect,
|
||||||
ViewedStorage.init,
|
ViewedStorage.init,
|
||||||
search_service.info,
|
search_service.info,
|
||||||
dev_pid
|
start_sentry,
|
||||||
|
start
|
||||||
],
|
],
|
||||||
on_shutdown=[
|
on_shutdown=[
|
||||||
redis.disconnect
|
redis.disconnect
|
||||||
|
|
|
@ -1,24 +1,5 @@
|
||||||
from ariadne import MutationType, QueryType # , ScalarType
|
from ariadne import MutationType, QueryType
|
||||||
|
|
||||||
|
|
||||||
# datetime_scalar = ScalarType("DateTime")
|
|
||||||
query = QueryType()
|
query = QueryType()
|
||||||
mutation = MutationType()
|
mutation = MutationType()
|
||||||
|
resolvers = [query, mutation]
|
||||||
|
|
||||||
# @datetime_scalar.serializer
|
|
||||||
# def serialize_datetime(value):
|
|
||||||
# return value.isoformat()
|
|
||||||
|
|
||||||
|
|
||||||
# NOTE: was used by studio
|
|
||||||
# @query.field("_service")
|
|
||||||
# def resolve_service(*_):
|
|
||||||
# # Load the full SDL from your SDL file
|
|
||||||
# with open("schemas/core.graphql", "r") as file:
|
|
||||||
# full_sdl = file.read()
|
|
||||||
#
|
|
||||||
# return {"sdl": full_sdl}
|
|
||||||
|
|
||||||
|
|
||||||
resolvers = [query, mutation] # , datetime_scalar]
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user