core/services/schema.py

25 lines
528 B
Python
Raw Normal View History

2023-10-06 09:51:07 +00:00
from ariadne import ScalarType, QueryType, MutationType
2021-07-02 09:16:43 +00:00
datetime_scalar = ScalarType("DateTime")
2023-10-06 09:51:07 +00:00
query = QueryType()
mutation = MutationType()
2021-07-02 09:16:43 +00:00
2022-09-03 10:50:14 +00:00
2021-07-02 09:16:43 +00:00
@datetime_scalar.serializer
def serialize_datetime(value):
2022-09-03 10:50:14 +00:00
return value.isoformat()
2021-07-02 09:16:43 +00:00
2023-11-22 16:38:39 +00:00
# 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}
2023-10-06 09:51:07 +00:00
2023-10-05 21:34:08 +00:00
resolvers = [query, mutation, datetime_scalar]