You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we are using GraphQLWsLink to establish subscriptions to our graphql server. We are able to establish the connection and the subscriptions are working fine. But one problem we currently face is that we need to re-establish the websocket connection after the access token is renewed (happens every 30 minutes).
For history reasons we sadly have to passt the access token as query param on the websocket connection uri. How can we reconnect/recreate the websocket connection so the new access token is used?
We are already using an async function for url in the createClient options. But this does automatically create a new connection. Would this be easier if we would change our setup to support connectionParams? Or does this also not reconnect the connection?
Would be very helpful if somebody can give some guidance on how to properly reconnect the websocket connection on access token renewal.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
we are using
GraphQLWsLink
to establish subscriptions to our graphql server. We are able to establish the connection and the subscriptions are working fine. But one problem we currently face is that we need to re-establish the websocket connection after the access token is renewed (happens every 30 minutes).For history reasons we sadly have to passt the access token as query param on the websocket connection uri. How can we reconnect/recreate the websocket connection so the new access token is used?
We are already using an async function for
url
in thecreateClient
options. But this does automatically create a new connection. Would this be easier if we would change our setup to supportconnectionParams
? Or does this also not reconnect the connection?Would be very helpful if somebody can give some guidance on how to properly reconnect the websocket connection on access token renewal.
Cheers, Kai
Beta Was this translation helpful? Give feedback.
All reactions