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
I want to emit to my Subscription with pubSub.publish() when a user subscribes to my subscription following my custom auth checker. I tried to do this in the onSubscribe and onOperation of graphql-ws, but it does not get sent over the websocket, and I assume it is because type-graphql is sill checking auth and whatnot.
Is there a way to run code after a Subscription is successfully authorized? I tried a Middleware, but those only run on publish, and not only on connect.
My current workaround it to just setTimeout in the onOperation of graphql-ws but I'd like a more stable approach. Any ideas?
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
-
I want to emit to my Subscription with
pubSub.publish()
when a user subscribes to my subscription following my custom auth checker. I tried to do this in theonSubscribe
andonOperation
ofgraphql-ws
, but it does not get sent over the websocket, and I assume it is becausetype-graphql
is sill checking auth and whatnot.Is there a way to run code after a Subscription is successfully authorized? I tried a Middleware, but those only run on publish, and not only on connect.
My current workaround it to just
setTimeout
in theonOperation
ofgraphql-ws
but I'd like a more stable approach. Any ideas?Beta Was this translation helpful? Give feedback.
All reactions