Comments (11)
I think you're right - this also came up in #13
from graphql-subscriptions.
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
from graphql-subscriptions.
Yeah, a PR would be great! Thanks @gluck
from graphql-subscriptions.
This is not pubsub based on obsevables im sorry
You are replacing one broken api with a mutation of the existing one.
If you want observable based api, then a resolver should return an observable.
from graphql-subscriptions.
@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.
from graphql-subscriptions.
To me, Observables are a neat match for pubsub, Rx Subject
concept is very much that.
That being said my graphQL resolvers are also Observables (to which I apply .take(1).toPromise()
before passing them to graphql-js).
If you suggest (query) schema resolvers (as observables) can be leveraged for realtime updates (@live
?), I'm interested, because I haven't found how to do that.
from graphql-subscriptions.
then take a look at this: https://github.com/DxCx/webpack-apollo-server/blob/rxjs-subscriptions/src/schema/modules/subscription.ts#L10
note that clockSource is Observable (https://github.com/DxCx/webpack-apollo-server/blob/rxjs-subscriptions/src/main.ts#L15)
graphql-rxjs
is a modified graphql library which has observables support,
at the moment i'm working to provide a full example (server-client) usecase (although i dont have the time i want those days to progress as i want :() then i believe it will be merged to offical graphql package.
from graphql-subscriptions.
@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.
from graphql-subscriptions.
@thebigredgeek I wasn't advocating for rxjs dependency, and I agree it would be a bad idea for a core library.
Though you can support ES7 observables along with promises with no extra dependency (duck typing), and that's usually a good idea IMO, e.g. That's what graphIQL does.
from graphql-subscriptions.
Awesome. Sorry I think my typo of putting of not putting NOT
in my first sentence might have caused this to come across as edgy, which was not intended. Just edited
from graphql-subscriptions.
@gluck
A lot has changed since this issue, and now SubscriptionsManager
is deprecated, and the PubSub
no longer attached to the subscriptions handler.
from graphql-subscriptions.
Related Issues (20)
- Transfer maintenance and resurrect graphql-subscriptions HOT 9
- Weird Apollo server error-could not connect to endpoint
- Peer Dependency Mismatch HOT 5
- Can't use async/await with withFilter function HOT 2
- Cannot Install on Node 16 NPM 8 HOT 1
- Using pubsub in onConnect and onDisconnect
- Complete event is never fired when using withFilter & graphql-redis-subscriptions
- Expose a way to wait for async iterator to subscribe HOT 1
- WSS graphql subscripiton issue on Nodejs
- Websocket endpoint issue
- Ability to dynamically add/remove topics to/from asyncIterator
- Better error should be thrown if subscription ID is invalid
- Using directives with subscriptions HOT 1
- Subscription: make `Subscription` resolver independent of resolvers for `Create` and `Update` records
- reject subscription if already initialised
- Return type of pubsub.asynctIterator should include AsyncIterable HOT 2
- Who does the logic to add graphql spec fields on the payload like `__typename`?
- inside docker graphql-redis-subscriptions searches to connect to localhost HOT 2
- Nest JS: Object is possibly 'undefined' in GraphQL
- Can the pubsub-async-iterator properties and methods be protected instead of private?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-subscriptions.