GithubHelp home page GithubHelp logo

Comments (11)

stubailo avatar stubailo commented on May 18, 2024

I think you're right - this also came up in #13

from graphql-subscriptions.

gluck avatar gluck commented on May 18, 2024

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.

helfer avatar helfer commented on May 18, 2024

Yeah, a PR would be great! Thanks @gluck

from graphql-subscriptions.

DxCx avatar DxCx commented on May 18, 2024

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.

helfer avatar helfer commented on May 18, 2024

@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.

gluck avatar gluck commented on May 18, 2024

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.

DxCx avatar DxCx commented on May 18, 2024

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.

thebigredgeek avatar thebigredgeek commented on May 18, 2024

@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.

gluck avatar gluck commented on May 18, 2024

@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.

thebigredgeek avatar thebigredgeek commented on May 18, 2024

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.

dotansimha avatar dotansimha commented on May 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.