Don't fall back to Apollo when not in subprotocols#586
Don't fall back to Apollo when not in subprotocols#586jaylett wants to merge 3 commits intographql-python:masterfrom
Conversation
If the server doesn't return Sec-WebSocket-Protocol, we can't default to graphql-ws (ie Apollo) if the transport was configured without it as a subprotocol. In that situation, default to graphql-transport-ws (GRAPHQLWS).
|
I've encountered a live server that doesn't seem to include I'm not sure how to write a test for this, because I don't really understand how the (mocked?) servers work. |
|
Hmm, the lint failure suggests that something other than the normal control path can create the adapter, given the normal WebsocketsProtocolTransportBase always sets subprotocols on the adapter. I'll push a fix for this once the other tests have run. |
|
For the tests, you have different server pytest fixtures in the
Then you have fixtures like We have the So, if we want to test that your modification is working, you could in the |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #586 +/- ##
===========================================
- Coverage 100.00% 99.96% -0.04%
===========================================
Files 38 40 +2
Lines 2908 3314 +406
===========================================
+ Hits 2908 3313 +405
- Misses 0 1 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I can add that test if you want. |
If the server doesn't return Sec-WebSocket-Protocol, we can't default to graphql-ws (ie Apollo) if the transport was configured without it as a subprotocol. In that situation, default to graphql-transport-ws (GRAPHQLWS).