Closed wmadfaa closed 3 weeks ago
Hey there! Thanks for reproting this and good catch on how to fix it in the meantime. Do you think it's worth implementing in the library or adding a comment in the documentation for anyone that may face the same issue?
Hey there! Thanks for reproting this and good catch on how to fix it in the meantime. Do you think it's worth implementing in the library or adding a comment in the documentation for anyone that may face the same issue?
Hi!, yes adding a comment in the documentation is a good idea! I'll close the issue and open a pr with the changes asap
Screenshot N/A
Expected Behaviour Using
graphql-ws@^5.16.0
with Deno 2.0.3, the WebSocket connection should successfully establish with theGRAPHQL_TRANSPORT_WS_PROTOCOL
protocol in accordance with the sample code provided by the library.Actual Behaviour The WebSocket connection fails because
Deno.upgradeWebSocket
returns a WebSocket object with an emptyprotocol
property, causing a protocol mismatch and connection cancellation in themakeServer
handler.Debug Information This issue appears to stem from a conditional check within the
makeServer
function, where an emptyprotocol
string results in an unsuccessful connection:makeServer
Further Information The issue is likely rooted in Deno's handling of the
protocol
property inDeno.upgradeWebSocket
. For now, the workaround is to use aProxy
object to intercept and set theprotocol
asGRAPHQL_TRANSPORT_WS_PROTOCOL
, as shown below: