feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
15.08k stars 750 forks source link

GraphQL Support? #149

Closed kwcto closed 8 years ago

kwcto commented 9 years ago

I'm still learning GraphQL (https://learngraphql.com) but my first impression is that the support for multiple/batched reads/writes and "selectable" schema would be powerful when combined with the rest of the feathers workflow. Thoughts?

daffl commented 9 years ago

I read the introductory post a while ago and just scrolled through the GraphQL spec and I think it makes sense to explore this option a little more.

Currently Feathers supports query batching through feathers-batch and all 1.0 db adapters support field querying through the $select special query param (see e.g. here for feathers-nedb). We are also working on nested services in feathers-associations and schemas can be easily implemented via feathers-hooks.

It seems like those are doing a lot of the things that - at least from what I understand - GraphQL covers as well. It almost looks as if a GraphQL adapter would just consolidate all those separate features into a unified interface (the full spec looks like a bit to work through ;).

Once you learned a little more maybe you can help answer some of the questions that came to my mind:

daffl commented 9 years ago

Also, besides the current real-time events (which might potentially be hard to correlate with your GraphQL query results), could we have such thing as real-time GraphQL queries? How could that look like?

daffl commented 9 years ago

In fact, this may be solved with adding support for Waterline because we can just use https://github.com/wistityhq/waterline-graphql. /cc @ekryski

kwcto commented 9 years ago

Haven't had a chance to experiment with GraphQL much more but I'm glad there may be a simple way to add support. Makes evangelizing Feathers that much easier :+1:

ekryski commented 9 years ago

We're making some progress here. Once https://github.com/feathersjs/feathers-waterline is complete (still in the works) you will be able to use https://github.com/wistityhq/waterline-graphql and should make using graphql rather trivial.

We'll probably just need to document an example.

daffl commented 8 years ago

The first version of feathers-waterline has been published which should allow using the Waterline GraphQL module. I haven't tested it yet but if there are any issues with the integration it can be reported in the Waterline adapter.

andrejunges commented 8 years ago

https://twitter.com/feathersjs/status/753312499882201088

http://halcyonlabs.io/blog/2016/07/13/eagle-has-landed/

ekryski commented 8 years ago

Thanks for adding that @andrejunges! ^ that is the recommended way so far. I believe the repo is a bit more up to date. https://github.com/swarthout/feathers-apollo

subodhpareek18 commented 7 years ago

How about being able to use other middlewares? something like this is pretty great. https://github.com/calebmer/postgraphql

Though as the name suggests it only works with postgres.

I'm pretty new to feathers, but would love to be able to write a feathers-postgraphql service for a middleware like this if possible.

Also wondering if there is an easy way to convert a regular ol express middleware into a service. Express middlewares work fine with feathers, but they obviously don't register as other feathers-services.

thelaith commented 6 years ago

Status on @subodhpareek18 suggestion - would love to know if a decision has been made, since it's been a year.

eddyystop commented 6 years ago

One option is the docs for a graphql adapter will be available within a month. A repo to help generate resolvers will be available the month after that.

lock[bot] commented 5 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs.