-
Notifications
You must be signed in to change notification settings - Fork 426
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
Merge juniper_graphql_transport_ws
and juniper_graphql_ws
crates (#1022)
#1196
Conversation
@ccbrown since you're the original author, would like to see any comments on this before merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! I just have one non-blocking question.
[features] | ||
graphql-transport-ws = [] | ||
graphql-ws = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why gate these behind features at all? The modules for these are small and don't pull in additional dependencies. Unless I'm missing something, as a user I'm not sure why I would ever want to explicitly enable or disable these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ccbrown I was thinking that some people may want to opt-in for the concrete protocol version and don't consider another one at all, thus avoid increasing compilation times and auto-completion pollution in any way.
Part of #1022
Resolves #1186
Follows #1158, #1191
Motivation
Despite the raised concern for the initial implementation #1158 (comment):
Integration of both protocols into a single crate showed, that fully separate crates (and therefore, types) introduce integration problems, which are resolved by reusing same types in both crates.
Following this, as we aim to support both protocols in our HTTP integration crates, both
juniper_graphql_transport_ws
andjuniper_graphql_ws
crates are always used and depend on each other, which makes a little sense to support them a separate crates.Solution
Instead, it's enough to keep only one
juniper_graphql_ws
crate, where support both protocols via additive Cargo features. This will simplify maintenance and usage costs, while allowing to reuse similar types naturally, giving the desired level of polymorphism for supporting both protocols at the same time.Checklist