Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example of tracking user in onDisconnect callback #4632

Closed
wants to merge 1 commit into from

Conversation

SergeNarhi
Copy link

@SergeNarhi SergeNarhi commented Oct 7, 2020

Add example of tracking user in onDisconnect callback. See #1597 and apollographql/subscriptions-transport-ws#95 for details.

add example of tracking user in onDisconnect callback
@SergeNarhi SergeNarhi changed the title Update subscriptions.md Add example of tracking user in onDisconnect callback Oct 7, 2020
@rkoron007 rkoron007 added the 📝 documentation Focuses on changes to the documentation (docs) label Jun 30, 2022
@trevor-scheer
Copy link
Member

Sorry for the delay on this @skanygin. We no longer recommend or document how to use subscriptions-transport-ws (in favor of graphql-ws).

If you find this use case particularly interesting, I'd be happy to review a PR which transposes the example you've provided over to the graphql-ws equivalent in our subscriptions docs:
https://github.com/apollographql/apollo-server/blob/main/docs/source/data/subscriptions.mdx

Worth mentioning the ctx object in our onConnect / onDisconnect example might sufficiently illustrate the fact that the context is shared between those functions. Or maybe the example could be expanded on just a bit to demonstrate your concept a bit more readily.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📝 documentation Focuses on changes to the documentation (docs)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants