-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Apollo koa integration #59
Conversation
@HriBB: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
@HriBB First of all, thanks a lot for the PR! It looks like all the tests pass, but there are still some linter errors that you should fix:
For the empty blocks, you can just make the I'll add comments about the code inline. |
@@ -80,6 +84,7 @@ export default (createApp: CreateAppFunc) => { | |||
query: 'query test{ testString }', | |||
}); | |||
return req.then((res) => { | |||
destroyApp(app); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did afterEach
not work? That would be preferable to adding the call explicitly in every test, I think.
You are right, it's not a good plan, but I am not sure how to support both versions. Problem is that v2 uses a different syntax with async/await, where v1 uses generators/yield.
Not really sure how to tackle this. We could simply export two different versions such as |
@HriBB thanks, that looks great! Regarding the use of Koa 2 vs. 1, I found this interesting Medium post: https://medium.com/@l1ambda/why-you-should-use-koa-with-node-js-7c231a8174fa#.8h6opnbvy The tldr is that 2.0 alpha is considered stable, but they won't officially recommend it until Node has native support for async/await and Koa 2.0 can be used without Babel. I'd say we land this PR as it is, and consider rewriting it for Koa 1 if there are many requests for it. |
@HriBB can you update the Changelog to mention Koa support? The format should be something along the lines of
Once that's done, I can merge the PR, and I think we'll be ready to officially release the new apollo server tomorrow or on Monday! |
@helfer done! |
I hope I did not break anything with merging upstream ... |
Perfect, merged! |
Use named exports instead of default so that composeAndValidate is exported at the top level of the package.
Use named exports instead of default so that composeAndValidate is exported at the top level of the package.
KoaJS apollo-server integration. All tests pass, but I still need to test it in a real-life application.
TODO: