Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Restify support #85

Closed
rricard opened this issue Aug 6, 2016 · 11 comments
Closed

Proposal: Restify support #85

rricard opened this issue Aug 6, 2016 · 11 comments

Comments

@rricard
Copy link

rricard commented Aug 6, 2016

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!

@helfer
Copy link
Contributor

helfer commented Aug 6, 2016

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

@rricard
Copy link
Author

rricard commented Aug 7, 2016

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!

@rricard
Copy link
Author

rricard commented Aug 7, 2016

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!

@stubailo
Copy link
Contributor

stubailo commented Aug 8, 2016

@rricard can't you use Apollo Server the same way? http://docs.apollostack.com/apollo-server/setup.html#apolloExpress

@rricard
Copy link
Author

rricard commented Aug 8, 2016

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

@helfer
Copy link
Contributor

helfer commented Aug 8, 2016

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

@helfer
Copy link
Contributor

helfer commented Aug 27, 2016

@rricard are you still interested in this? I think it would be pretty useful! Let me know if I can help in any way.

@rricard
Copy link
Author

rricard commented Aug 27, 2016

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

@rricard
Copy link
Author

rricard commented Sep 7, 2016

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

@rricard
Copy link
Author

rricard commented Sep 7, 2016

Closing in favor of #125

@rricard rricard closed this as completed Sep 7, 2016
@stubailo
Copy link
Contributor

stubailo commented Sep 7, 2016

Thank for looking into this!

trevor-scheer added a commit that referenced this issue May 6, 2020
Expose query plan via `response.extensions`
trevor-scheer added a commit that referenced this issue May 14, 2020
Expose query plan via `response.extensions`
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants