Websocket keeps throwing connection failed #387
-
Screenshot Expected Behaviour Actual Behaviour Debug Information const wsLink2 = new GraphQLWsLink(
createClient({
url: GRAPHQL_MIDDLEWARE_URL.replace("http", "ws"),
shouldRetry: (err) => {
console.log("shouldRetry:", err, err?.eventPhase);
return true;
},
lazy: false,
connectionParams: getExtraHeaders,
})
); This is the const getExtraHeaders = () => ({ Authorization: AUTH, scope: IAM_SCOPE }); Here is the code for the Apollo Client: // The multiplexing link that selects the correct transport for the correct
// GraphQL Operation
const splitTransportLink = split(
// IF
isSubscription,
// THEN
// wsLink,
wsLink2,
// ELSE
httpLink
);
const client = new ApolloClient({
link: ApolloLink.from([splitTransportLink]),
cache: new InMemoryCache(),
}); Further Information |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As stated in the readme disclaimer, this library is not compatible with the deprecated Please make sure that your server is running |
Beta Was this translation helpful? Give feedback.
As stated in the readme disclaimer, this library is not compatible with the deprecated
subscriptions-transport-ws
.Please make sure that your server is running
graphql-ws
too, or is implementing the current GraphQL over WebSocket Protocol.