-
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
Hapi: Pass toolkit to context function #1407
Conversation
@maxnachlinger: 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/ |
Hey folks, I'd love a review of this micro |
CHANGELOG.md
Outdated
@@ -4,7 +4,7 @@ All of the packages in the `apollo-server` repo are released with the same versi | |||
|
|||
### vNEXT | |||
|
|||
- Pass the response tollkit to the context function. [#1407](https://github.com/apollographql/apollo-server/pull/1407) |
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.
Hey my tollkit
was... you know, trying to generate revenue for this awesome open-source project or something :) Me no make text good.
@maxnachlinger This looks great! Thank you so much. It would be awesome to have a test for the context function to ensure that there is a toolkit. Adding it here is the best bet. Let me know if I can help with that more! |
@@ -223,6 +234,33 @@ describe('apollo-server-hapi', () => { | |||
await apolloFetch({ query: '{hello}' }); | |||
}); | |||
|
|||
it('passes each request and response toolkit through to the context function', async () => { |
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.
@evans This seems like a better test, what do you think?
@evans This is ready for another review |
BTW The build failure ins't relevant to this PR :( It's failing on:
|
+1 , we'd like to get this toolkit into our resolvers! |
@maxnachlinger Thank you so much! |
Curious as to how this is then used within the resolver. When I tried to modify the response with the toolkit, any headers that are set for example are stripped out in the final response presumably by Apollo. How are people intending this be used? |
Fixes #1382
TODO: