-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useSubscription not able to create a socket connection #11334
Comments
Hi @prabhashms 👋🏻 thanks for letting us know about this! Unfortunately it's difficult to know what the issue might be without being able to run the code that you're sharing. I recommend sharing a runnable reproduction so the community and maintainers can help narrow down whether this is an issue with your application code or with Apollo Client. Looking forward to hearing back from you 🙏🏻 |
Hi @bignimbus, the only other info I'm able to provide at the moment is that the frontend is running on port 3000 and the backend is running on port 8097. For some reason, the client is making two websocket calls (attached screenshot below). One is to |
One for piece of information is that I've used create-react-app for building my application. and I'm running my UI behind NGINX reverse proxy. Following are my nginx configurations: `
} |
The first one is most likely due to hot module reloading in create-react-app (I assume that is running on port 3000?), so you can safely ignore that. Generally, the problem at hand looks to be between |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue Description
This is the client configuration that I'm using.
When I call useSubscription inside my component, it fails with 'socket closed' error.
It is failing specifically at this line
const socket = new WebSocketImpl(typeof url === 'function' ? await url() : url, GRAPHQL_TRANSPORT_WS_PROTOCOL);
Can someone help?
I'm using the following versions:
"react": "18.1.0",
"@apollo/client": "3.7.11",
"graphql": "16.7.1",
"graphql-ws": "5.14.2"
Link to Reproduction
NA
Reproduction Steps
No response
The text was updated successfully, but these errors were encountered: