Added subscriptions final #181
All checks were successful
Test before pr merge / test-lint (pull_request) Successful in 7s

This commit is contained in:
2025-10-08 21:22:51 +02:00
parent 3774cef56a
commit 545540d05d
14 changed files with 243 additions and 116 deletions

View File

@@ -86,15 +86,10 @@ class PostSubscription(Subscription):
Subscription.__init__(self)
self._bus = bus
async def post_changed():
async for event in await self._bus.subscribe("postChange"):
print("Event:", event, type(event))
yield event
def selector(event: Post, info) -> bool:
return True
return event.id == 101
self.subscription_field("postChange", PostGraphType, post_changed, selector)
self.subscription_field("postChange", PostGraphType, selector).with_public()
class PostMutation(Mutation):