Skip to content

Observables instead of Promises #501

Closed
@DxCx

Description

@DxCx

Hi guys,

As more I'm thinking about it the more i think it should be done,
So before I'm submitting a PR i would like to hear your thoughts about it.

So basically i want to add support for Observables (RxJs? Any other preferred library?) so resolver function will be able to return Observables as well (Observable | Promise | any)

Then create another execute function that will return Observable while chaining the original execute to call it with Observable.toPromise() function.

This way GraphQLResult can be reactive and this can be really useful for subscriptions and later in the future @live \ @stream \ @defer directives..

For the initial implementation I'm planing to always take(1).. later make it fully reactive..

So, what do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions