-
-
Notifications
You must be signed in to change notification settings - Fork 110
Closed
Description
Currently the connectionParams in subscriptionClient always returns either of authorization
or an empty object depending on the availability of the token. Source here
This convention doesn't work with Hasura GraphQL Engine as Hasura expects a header
object to be returned in connectionParams with authorization key inside the object.
So this is what works with Hasura:
wsClient = new SubscriptionClient(wsEndpoint, {
reconnect: true,
connectionParams: () => {
const authorization = getAuth(tokenName)
return authorization ? { headers: { authorization } } : {}
},
})
Note the authorization object wrapped in a top level headers key.
I think it's better not to assume any convention in the way connectionParams is handled, since different servers will have different ways to handle this.
I would like the plugin to allow the user to define their custom method for connectionParams
, similar to getAuth
.
Metadata
Metadata
Assignees
Labels
No labels