diff --git a/example/queries/calendar.py b/example/queries/calendar.py index e1e8638..6c8a86c 100644 --- a/example/queries/calendar.py +++ b/example/queries/calendar.py @@ -3,7 +3,6 @@ from ariadne_graphql_modules import GraphQLObject from graphql import GraphQLResolveInfo -from ..database import db from ..scalars.date import DateScalar from ..scalars.datetime import DateTimeScalar diff --git a/example/scalars/date.py b/example/scalars/date.py index 28ff68f..1d0a347 100644 --- a/example/scalars/date.py +++ b/example/scalars/date.py @@ -14,4 +14,4 @@ def serialize(cls, value: Union["DateScalar", date]) -> str: @classmethod def parse_value(cls, value: str) -> date: - return datetime.strptime("%Y-%m-%d").date() + return datetime.strptime(value, "%Y-%m-%d").date() diff --git a/example/subscriptions/events.py b/example/subscriptions/events.py index 910c309..017cb2e 100644 --- a/example/subscriptions/events.py +++ b/example/subscriptions/events.py @@ -13,6 +13,7 @@ class Subscription(GraphQLSubscription): event: EventType @GraphQLSubscription.source("event") + @staticmethod async def source_event(obj, info: GraphQLResolveInfo) -> AsyncGenerator[int, None]: i = 0 @@ -22,5 +23,6 @@ async def source_event(obj, info: GraphQLResolveInfo) -> AsyncGenerator[int, Non await sleep(float(random.randint(1, 50)) / 10) @GraphQLSubscription.resolver("event") + @staticmethod async def resolve_event(obj: int, info: GraphQLResolveInfo) -> dict: return {"id": obj, "payload": datetime.now()}