Is there any way to work with socket.io instance in resolver? #917
-
Hi. I need to emit a socket.io event and can't understand really, how can I pass a socket.io (completely same) instance from index.ts to resolver? |
Beta Was this translation helpful? Give feedback.
Answered by
MichalLytek
Jun 15, 2021
Replies: 1 comment
-
Put the socket instance into |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tmelent
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put the socket instance into
context
function of apollo server. Then you can get the context object with socket by@Ctx()
decorator in resolver method.