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
When using subscriptions, both the resolver and the subscription handler receive None as the context, regardless of what is passed in to register_graphql_handlers.
I was expecting that context to be the same context (though a unique instance as for all requests) that is received by query and mutation resolvers. I wondered how the examples worked but then noticed that it just uses a global instead of passing the redis connection through the context.
I noticed that for subscriptions the context is being pulled from the websocket message payload, which seems odd to me but maybe I don't fully understand:
When using subscriptions, both the resolver and the subscription handler receive None as the context, regardless of what is passed in to register_graphql_handlers.
I was expecting that context to be the same context (though a unique instance as for all requests) that is received by query and mutation resolvers. I wondered how the examples worked but then noticed that it just uses a global instead of passing the redis connection through the context.
I noticed that for subscriptions the context is being pulled from the websocket message payload, which seems odd to me but maybe I don't fully understand:
tartiflette-aiohttp/tartiflette_aiohttp/_subscription_ws_handler.py
Line 29 in e2c48e0
Here's an small example app that demos the behavior I'm seeing:
Which produces output:
The text was updated successfully, but these errors were encountered: