retry websocket connection on failure (fix #198) (#200)

This commit is contained in:
Rishichandra Wawhal 2018-07-24 15:22:47 +05:30 committed by Shahidh K Muhammed
parent ad31f02b51
commit 9b61964b71

View File

@ -177,7 +177,6 @@ const createWsClient = (url, headers) => {
websocketProtocol = 'wss';
}
const headersFinal = getHeadersAsJSON(headers);
setTimeout(() => null, 500);
const graphqlUrl = `${websocketProtocol}://${url.split('//')[1]}`;
const client = new SubscriptionClient(graphqlUrl, {
connectionParams: {
@ -185,6 +184,7 @@ const createWsClient = (url, headers) => {
...headersFinal,
},
},
reconnect: true,
});
return client;
};