Add to README or just comment here and I'll PR to README.
For posterity:
const wsLink = new WebSocketLink({
uri: `wss://xyz.herokuapp.com/v1alpha1/graphql`,
options: {
reconnect: true,
connectionParams: {
headers: {
'content-type': 'application/json',
'x-hasura-admin-secret': 'SUPERPASSWORD',
},
},
},
})
Where should I pass token with a Bearer? Please reply I m stuck with this issue
const wsLink = new WebSocketLink({
uri: `wss://xyz.herokuapp.com/v1alpha1/graphql`,
options: {
reconnect: true,
connectionParams: {
headers: {
'content-type': 'application/json', // these are headers
'x-hasura-admin-secret': 'SUPERPASSWORD',
'Authorization': 'Bearer iasjdfoias2j34j23i4j23ij1jsdjsa' // i haven't tested this but this is typically how you send a JWT
},
},
},
})
This does not seem to work anymore.
See https://github.com/apollographql/subscriptions-transport-ws/issues/662#issuecomment-685464873. Will not work in a browser.
Most helpful comment
For posterity: