-
Notifications
You must be signed in to change notification settings - Fork 179
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 on_connect/on_disconnect hooks to ASGI app, support connection context #488
Conversation
This pull request introduces 1 alert when merging 2c0a2de into a732a7c - view on LGTM.com new alerts:
|
2c0a2de
to
27d6071
Compare
Codecov Report
@@ Coverage Diff @@
## master #488 +/- ##
==========================================
+ Coverage 98.16% 98.19% +0.02%
==========================================
Files 104 104
Lines 5125 5253 +128
==========================================
+ Hits 5031 5158 +127
- Misses 94 95 +1
Continue to review full report at Codecov.
|
This pull request introduces 1 alert when merging 27d6071 into 903d217 - view on LGTM.com new alerts:
|
This is great! When can y'all get this released? |
Adds
on_connect
andon_disconnect
options to ASGI GraphQL app and introduces connection context.on_connect
on_connect
is optional callable that is called when GraphQL client opens WebSocket connection with the server. It's called with two arguments:WebSocket
instance andAny
value with connection payload. It can be used to extract supported data from connection's payload to the current scope:As bonus, users may raise new
WebSocketConnectionError
fromon_connect
to get nice error masse sent to client:on_disconnect
on_disconnect
is optional callable that is called when GraphQL client closes websocket connection. Receives one argument:WebSocket
instance.Supersedes #406, #403 and #355.