Hello Hot Chocolate Community,
I'm having trouble setting up websockets for my Hot Chocolate GraphQL server in my local environment. I have followed the documentation and added app.UseWebSockets()
to my ASP.NET Core application, which is running on my local machine. However, when I try to connect to the websocket at ws://localhost:7217/graphql/
using wscat
, I get the error "socket hang up". Similarly, when I try to connect from my React app using Apollo Client, I get the error "websocket connection to 'ws://localhost:7217/graphql/ws
' failed".
I would appreciate any help in figuring out what is causing the issue. Here are some additional details:
Thank you for your assistance.
So after a lot of investigation and texting with the hotchocolate stuff, which indeed is very open to help. (Checkout there Slack channel).
I tried again via Apollo Client and checked how the connection got established via Banana Cake Pop: They use wss
instead of ws
, which is great for me.
So I could establish the connection with apollo client by switching the uri to wss