I’m trying for some days now to configure an apollo client link to be able to use subscription
with my meteor app with no success.
import { WebSocketLink } from 'apollo-link-ws';
...
const wsUri = "ws://localhost:4001/graphql";
const wsLink = () =>
new WebSocketLink({
uri: wsUri,
options: {
reconnect: true,
},
});
const apolloClient = new ApolloClient({
connectToDevTools: true,
link: ApolloLink.from([
...
wsLink(),
]),
cache: new InMemoryCache(),
});
I get the error:
WebSocket connection to 'ws://localhost:4001/graphql' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
Any Help?