Skip to content

Send message only to a specific connected clients #338

Answered by enisdenjo
RatkoR asked this question in Q&A
Discussion options

You must be logged in to vote

This is GraphQL WebSocket library, so you may achieve that only through GraphQL. A subscription would look roughly like this:

subscription {
  onQRAvailable(key: "unique key of client") {
    qrCodeData
  }
}

and them emit the event through GQL matching the key of the client.

However, a better question is: why even use WebSockets for this? Why not use HTTP which is meant for activities like the one you're describing - an HTTP request on button click whose response is the QR image data.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@RatkoR
Comment options

@enisdenjo
Comment options

Answer selected by enisdenjo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants