How do I send websocket message from the client? #294
Answered
by
enisdenjo
dulguun0225
asked this question in
Q&A
-
Hello. I'm migrating a existing project to wsLink.subscriptionClient.sendMessage({
type: 'messengerConnected',
value: messengerData
}); I want to send a websocket message from the client just like the previous code. How do I do that? |
Beta Was this translation helpful? Give feedback.
Answered by
enisdenjo
Jan 10, 2022
Replies: 1 comment 3 replies
-
You cannot. Even if you could send a custom message (like the one from your example), a GraphQL over WebSocket compliant server would terminate the connection immediately since invalid messages are considered fatal. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
dulguun0225
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You cannot.
graphql-ws
is in control over the message transport. You can onlysubscribe
.Even if you could send a custom message (like the one from your example), a GraphQL over WebSocket compliant server would terminate the connection immediately since invalid messages are considered fatal.