You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
Reacted by David Yahalomi, Ohad Galor Kimchi, Aihorn Mac, Sibelius Seraphini, Jean-Baptiste Musso, Forrest Galloway, Cory Simmons, Lucas Azzola, Patrick McDonald, Sam Silva and 3 more
Amazing idea. I think it will open a door for far better architecture and maintainability.
Further more observables natural for reactivity or pub/sub and they are by far the best way I currently know to manipulate data.
Closing this issue. Observables are exciting but do not yet have clear behavior relative to the GraphQL spec. Since this repository stands to be a production server and reference implementation, I don't think it's the right place to experiment with this.
I'm looking forward to seeing this sort of experimentation happen in additional libraries that don't need to rely on spec compliance. See more comments on this in #502.
Also just a note that the versions of @defer and @stream I've prototyped in Facebook's server have not required Observable, so we should be able to still pursue those ideas without this approach.
Reacted by Ohad Galor Kimchi, Pierre Martin, Dillon Buchanan, Ashley Claymore, Cory Simmons, Rick, Andreas Kuckartz, Sam Silva, Mike Pearson, 0zkr1 and 3 more
hey @shtse8,
original graphql tests are passing, i've played with it with couple of scenerios and made some PoCs and it looks like it works well..
however, it's not running on any major production environments..
you are welcome to give it a try, i'll try to support as much as i can..
Activity
davidyaha commentedon Sep 23, 2016
I think
@deferand@streamcould also benefit from observables.It will allow us to use the sweet power of observables in the server as well as the client.
Excellent proposition @DxCx!
ohadgk commentedon Sep 23, 2016
Amazing idea. I think it will open a door for far better architecture and maintainability.
Further more observables natural for reactivity or pub/sub and they are by far the best way I currently know to manipulate data.
DxCx commentedon Sep 24, 2016
Was just able to confirm that my idea works pretty well with subscription. (on unit test)
However the idea is simple:
that is needed because of arguments.
leebyron commentedon Nov 15, 2016
Closing this issue. Observables are exciting but do not yet have clear behavior relative to the GraphQL spec. Since this repository stands to be a production server and reference implementation, I don't think it's the right place to experiment with this.
I'm looking forward to seeing this sort of experimentation happen in additional libraries that don't need to rely on spec compliance. See more comments on this in #502.
Also just a note that the versions of
@deferand@streamI've prototyped in Facebook's server have not required Observable, so we should be able to still pursue those ideas without this approach.DxCx commentedon Feb 3, 2017
for everyone that is interested in this,
I've just release
graphql-rxjspackage which adds Observable support to graphql engine:https://www.npmjs.com/package/graphql-rxjs
Enjoy 👍
corysimmons commentedon Jun 21, 2017
lol thanks @DxCx 👏
shtse8 commentedon Nov 1, 2017
@DxCx Can we use it in the production?
DxCx commentedon Nov 2, 2017
hey @shtse8,
original graphql tests are passing, i've played with it with couple of scenerios and made some PoCs and it looks like it works well..
however, it's not running on any major production environments..
you are welcome to give it a try, i'll try to support as much as i can..
shtse8 commentedon Nov 2, 2017
@DxCx Thanks! I want to give it a try as I really want to use
@livedirective for live data.