2023-10-05 21:34:08 +00:00
|
|
|
from ariadne import MutationType, QueryType, ScalarType
|
2021-08-01 11:40:24 +00:00
|
|
|
|
2021-06-28 09:08:09 +00:00
|
|
|
|
2021-07-02 09:16:43 +00:00
|
|
|
datetime_scalar = ScalarType("DateTime")
|
|
|
|
|
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
|
|
|
|
2022-08-14 12:48:35 +00:00
|
|
|
query = QueryType()
|
2023-10-06 06:51:23 +00:00
|
|
|
|
|
|
|
@query.field("_service")
|
|
|
|
def resolve_service(*_):
|
2023-10-06 08:47:41 +00:00
|
|
|
# Load the full SDL from your SDL file
|
|
|
|
with open("inbox.graphql", "r") as file:
|
|
|
|
full_sdl = file.read()
|
|
|
|
|
|
|
|
return {"sdl": full_sdl}
|
2023-10-06 06:51:23 +00:00
|
|
|
|
2022-08-14 12:48:35 +00:00
|
|
|
mutation = MutationType()
|
2023-10-05 21:34:08 +00:00
|
|
|
resolvers = [query, mutation, datetime_scalar]
|