-
Notifications
You must be signed in to change notification settings - Fork 164
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
[Experimental] Added support for graphql-transport-ws #694
Conversation
@fallenwood Thanks for PR. Honestly, I do not think this is the right time for such PR. This project requires refactoring, simplification, cleaning everything unnecessary around subscriptions. PR brings additional complication, the need to support two protocols. Also note that all PRs with any backward incompatible changes should be targeted on |
Hey @sungam3r, is there any issue that could be worked on to refactor / simplify and get the code base ready for such a change? I started also a similar initiative some weeks ago and took the same approach as @fallenwood work. We could all benefit from supporting a more recent and supported subscription protocol. |
I am not ready to give certain advice. I only know that all code working with subscriptions requires refactoring (moving code around projects, changing dependencies, abstractions, making new projects, etc.). I was going to do this several times, but retreat. I do not use subscriptions, although I have some idea of how they work. |
I've been rewriting subscription support from scratch over the last week. It's probably 50% complete. It will not require a dependency on NOTE: I could really use assistance testing the new code - when it's ready - since I don't use subscriptions in my own codebases.Good news is that the proper members are marked virtual in v5.2 so that you can completely replace the subscription implementation with your own implementation. So what I may do (we will see) is create a separate project with the new code for testing, so you can copy the new project into your own codebase and 'plug it into' your existing code by a simple DI registration. Perhaps I would even release a beta nuget package, but I hope not to do so. If all is successful, this would all be available for all Server v5.2+ users. This does not cover refactoring the project in general, which badly needs to be done, but is waiting on graphql-dotnet/graphql-dotnet#2760 . The refactoring changes would need to go into the next major version of GraphQL and Server (v5 and v6 respectively). |
@fallenwood I really appreciate this PR, even if it is not ultimately merged, so I can see the changes needed for the new transport. I think we may still consider merging this PR for v5.3 if it does not cause breaking changes to existing clients. I would need to spend time to perform a careful review. (I think for now I will be spending my time to continue my rewriting efforts.) Please leave the PR open for now - thanks! |
Really appreciate your comments, I'll change the target to develop (although it's indeed compatible) and leave this one open. It's not urgent for me - in my project, some other transport is needed because websockets is not supported, and this PR is a side project for me to understand the subscription workflow :) - so I really looking forward to see the new implementation. Thanks |
See tests/ApiApprovalTests/*.approved.txt changes in this PR. You added new arguments in public ctors and did some other things. |
Ah, yes, you are right |
Add switchable support for
graphql-transport-ws
subprotocol defined at https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md.I have tested locally with a static html client to verify the subscription flow worked, but I am not sure if there is any other scenario that not supported.
Related to #492
The simple client