access connectionParams from Apollo client in Django channels custom middleware. #1892
Unanswered
btribouillet
asked this question in
General
Replies: 3 comments
-
Closing for now as I managed to inject the token as a query string in the WebsocketLink instance.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
So this solution is not consistent so I'm reopening the issue. And honestly, it felt wrong. |
Beta Was this translation helpful? Give feedback.
0 replies
-
The only solution I have for now is to keep the logic inside the consumer and inject the user into the context from there.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
This is a feature request unless there is a way I'm not aware of doing it.
So far it is easy to access the query string from the scope argument in the middleware. But Apollo client (GraphQL client) doesn't allow injecting URL params during subscriptions.
Use case:
I really wish to be able to pass the token in the query string / URL params but it seems only the connectionParams is reevaluated
Example of how the connectionParams is passed on the Apollo client:
Full code of the described issue on StackOverflow
Beta Was this translation helpful? Give feedback.
All reactions