Expose GraphQL subscriptions #83

Open
opened 2024-01-12 18:45:09 +02:00 by inex · 0 comments

GraphQL subscriptions are a way for a client to subscribe for updates of specific fields, defined in the subscription schema. Updates are sent using websockets.

Sources of real-time events:

  • Redis key updates (current focus)
    For example, when a Job is changed, push it to the client. We may use it for real-time updates of
    • Jobs list
    • Backups status and snapshot list
  • DBus (not used at the moment)
    • Changes of systemd unit statuses
  • Other events?
    • For example, when we know that some mutation changed something in our data model. TBD
  • Logs?
    • Real-time logs would be cool.

References on our stack

Blogs, architecture discussions

to be continued

GraphQL subscriptions are a way for a client to subscribe for updates of specific fields, defined in the subscription schema. Updates are sent using websockets. ### Sources of real-time events: - Redis key updates (current focus) For example, when a `Job` is changed, push it to the client. We may use it for real-time updates of - Jobs list - Backups status and snapshot list - DBus (not used at the moment) - Changes of systemd unit statuses - Other events? - For example, when we know that some mutation changed something in our data model. TBD - Logs? - Real-time logs would be cool. ## Relevant links ### References on our stack - https://strawberry.rocks/docs/general/subscriptions - https://redis.io/docs/interact/pubsub/ - https://redis.readthedocs.io/en/stable/advanced_features.html#publish-subscribe - https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api/src/branch/redis-experiments/selfprivacy_api/graphql/schema.py#L94 ### Blogs, architecture discussions - https://graphql.org/blog/subscriptions-in-graphql-and-relay/ - https://codehammer.io/graphql-example-real-time-chat-app-using-subscriptions/ ### Less related - https://jsonpatch.com (not really about this issue, but might be useful later) to be continued
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: SelfPrivacy/selfprivacy-rest-api#83
There is no content yet.