2023-10-06 00:34:08 +03:00
|
|
|
from ariadne import MutationType, QueryType, ScalarType
|
2021-08-01 11:40:24 +00:00
|
|
|
|
2021-06-28 12:08:09 +03:00
|
|
|
|
2021-07-02 12:16:43 +03:00
|
|
|
datetime_scalar = ScalarType("DateTime")
|
|
|
|
|
2022-09-03 13:50:14 +03:00
|
|
|
|
2021-07-02 12:16:43 +03:00
|
|
|
@datetime_scalar.serializer
|
|
|
|
def serialize_datetime(value):
|
2022-09-03 13:50:14 +03:00
|
|
|
return value.isoformat()
|
|
|
|
|
2021-07-02 12:16:43 +03:00
|
|
|
|
2022-08-14 15:48:35 +03:00
|
|
|
query = QueryType()
|
|
|
|
mutation = MutationType()
|
2023-10-06 00:34:08 +03:00
|
|
|
resolvers = [query, mutation, datetime_scalar]
|