Restify has been a popular option to create API servers a while back. As of today, at Jolicloud, we're using restify since it was decided a while back it was the right tool for the job. It is now wildly used in our codebase and we can't really detach ourselves from it.
Currently, we managed to get express-graphql work in it, even in production, but we'd like to have a really supported implementation with Apollo Server.
Since v0.2 was released, I was wondering if you planned to integrate it or if I could contribute by adding it as well.
Thank you!
@rricard Yes, I'm definitely for adding support for Restify! But at the moment I'm having a bit of trouble seeing how you would integrate it tightly with Apollo Server? Would you just use it as an alternative to Express, HAPI, Koa, etc?
Is the idea to essentially use Restify as a backend and automatically generate resolvers or a schema somehow?
If you have an example for how you integrated express-graphql in Restify and what you would like the integration to look like in an ideal world, that would be great!
The main issue with restify is it can't live with express in the same codebase since both override stuff globally. We need our graphql schema in the same codebase ...
Right now it looks like that:
const graphqlHTTP = require('express-graphql');
const graphQLEndpoint = graphqlHTTP(...);
app.get('/graphql', graphQLEndpoint);
app.post('/graphql', graphQLEndpoint);
It works but I think we could do better!
For instance we could define the graphql endpoint as a middleware. I'll try to think of a correct API and propose that to you!
@rricard can't you use Apollo Server the same way? http://docs.apollostack.com/apollo-server/setup.html#apolloExpress
Last time I checked, it failed with some restify internals (not express graphql). At least if we want to go that way and use restify via the express support, tests should be added to ensure restify is not broken. I should start with that...
@rricard Yeah, that's a great idea. If you add tests, that will also be a great way to point to concrete examples for how to use it.
@rricard are you still interested in this? I think it would be pretty useful! Let me know if I can help in any way.
@helfer yes, sorry, forgot a bit about it! I have a lot to do currently (mainly client stuff, that's why the PRs are going there... 馃槈 ) but yes, I still plan doing that at some point! I'll tell you then when I do it if you can help me!
@helfer I've got great news! I finally tried to run apollo-server on restify: it works perfectly 馃帀 . So the idea now is to write tests to ensure we don't break compat with restify, I'll work on that myself. I'll also write some docs on how to integrate w/ restify!
Closing in favor of #125
Thank for looking into this!
Most helpful comment
@helfer yes, sorry, forgot a bit about it! I have a lot to do currently (mainly client stuff, that's why the PRs are going there... 馃槈 ) but yes, I still plan doing that at some point! I'll tell you then when I do it if you can help me!