python-graphql-client
python-graphql-client copied to clipboard
Support "graphql-transport-ws" websocket subprotocol
For a project, where the server only accepts the graphql-transport-ws
protocol, I would like to add the option to define a specific protocol behavior.
What kind of change does this PR introduce?
Feature
What is the current behavior?
Only graphql-ws subprotocol is supported
What is the new behavior?
graphql-ws is still the default protocol, but it can be configured to use "graphql-transport-ws" as well.
Does this PR introduce a breaking change?
No
Other information
The practical difference here between the protocols is only the command structure of the init command, which only affects the name of the type. ws-graphql names is start, graphql-transport-ws calls is subscription 🤷♂️
The risk of this PR is relatively low, but it makes the library backwards compatible with older implementations which is a good thing to have I guess.
Sorry for now writing tests, I am not that proficient in python, so I would appreciate a little help here.
Thanks
@jenskdsgn thanks for the contribution could you by chance write some unit tests for ws_subprotocol
?
Yeah I can try 🙃