2023-10-06 09:51:07 +00:00
|
|
|
from ariadne import ScalarType, QueryType, MutationType
|
2021-06-28 09:08:09 +00:00
|
|
|
|
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-10-06 09:51:07 +00:00
|
|
|
@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-05 21:34:08 +00:00
|
|
|
resolvers = [query, mutation, datetime_scalar]
|