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

Hapi: Pass toolkit to context function #1407

Merged
merged 11 commits into from Jul 27, 2018
Merged

Hapi: Pass toolkit to context function #1407

merged 11 commits into from Jul 27, 2018

Conversation

maxnachlinger
Copy link
Contributor

@maxnachlinger maxnachlinger commented Jul 24, 2018

Fixes #1382

TODO:

  • Update CHANGELOG.md with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

@apollo-cla
Copy link

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

@maxnachlinger
Copy link
Contributor Author

Hey folks, I'd love a review of this micro , h] PR.

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)
Copy link
Contributor Author

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.

@evans
Copy link
Contributor

evans commented Jul 26, 2018

@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 () => {
Copy link
Contributor Author

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?

@maxnachlinger
Copy link
Contributor Author

@evans This is ready for another review

@maxnachlinger
Copy link
Contributor Author

BTW The build failure ins't relevant to this PR :( It's failing on:

Too long with no output (exceeded 10m0s)

@jessicabyrne
Copy link

+1 , we'd like to get this toolkit into our resolvers!

@evans evans changed the title Fix for #1382 Hapi: Pass toolkit to context function Jul 27, 2018
@evans evans merged commit 0b76e9e into apollographql:master Jul 27, 2018
@evans
Copy link
Contributor

evans commented Jul 27, 2018

@maxnachlinger Thank you so much!

@maxnachlinger maxnachlinger deleted the chore-fix-1382 branch July 27, 2018 23:50
@chasevida
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants