-
Notifications
You must be signed in to change notification settings - Fork 132
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
Publish API should be removed (me thinks) #15
Comments
I think you're right - this also came up in #13 |
I can PR that if you'd like, either by dropping the method entirely or dropping its definition/documentation/uses but keeping it (with a console warning) for backward (do we care at this stage ?). Thx |
Yeah, a PR would be great! Thanks @gluck |
This is not pubsub based on obsevables im sorry If you want observable based api, then a resolver should return an observable. |
@DxCx We're interested in improving the current implementation, and rewriting graphql-js isn't in scope. What we're doing is very closely aligned with what FB does internally, and I think it makes sense to keep it that way for now. |
To me, Observables are a neat match for pubsub, Rx If you suggest (query) schema resolvers (as observables) can be leveraged for realtime updates ( |
then take a look at this: https://github.com/DxCx/webpack-apollo-server/blob/rxjs-subscriptions/src/schema/modules/subscription.ts#L10
|
@gluck Yeah can we please NOT make Apollo or any of it's GraphQL componentry dependent on RxJS? That would create a lot of unnecessary overhead on the client to load such a massive library that is only going to be used in a couple of places. I personally think that it's overengineering to do so. Having a really simple API for pub/sub seems fine to me. If people wanna use Rx in their apps they can just create subjects or observables and wrap APIs with them. I don't think mandating usage is a great idea. |
@thebigredgeek I wasn't advocating for rxjs dependency, and I agree it would be a bad idea for a core library. |
Awesome. Sorry I think my typo of putting of not putting |
@gluck |
How one want to publish shouldn't matter to the SubscriptionManager, as the correct way to publish messages is through the onMessage callback.
I think the publish methods on PubSub and SubscriptionManager are confusing, as you can implement a correct (for now) server without them.
E.g. I implemented a PubSub based on Observables:
No need for publish (and I wouldn't know how to implement it if I wanted to).
It's fine for the default in-memory-event-based-pubsub-implementation to have a publish method, but it shouldn't be in the interface or wrapped in SubscriptionManager.
Thx.
The text was updated successfully, but these errors were encountered: