Skip to content

Support "graphql-transport-ws" websocket subprotocol #53

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jenskdsgn
Copy link

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

@xkludge
Copy link
Contributor

xkludge commented Jan 26, 2023

@jenskdsgn thanks for the contribution could you by chance write some unit tests for ws_subprotocol?

@jenskdsgn
Copy link
Author

Yeah I can try 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants