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

feature(apollo-engine-reporting): Add custom http agent support #1879

Conversation

eberhara
Copy link
Contributor

@eberhara eberhara commented Oct 25, 2018

This PR fixes #1836.

This PR enables developers to inject the http agent to be used on the network requests to apollo engine endpoint.

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

@eberhara eberhara changed the title feature(apollo-engine-reporting): Add custom http agent support to en… feature(apollo-engine-reporting): Add custom http agent support Oct 25, 2018
@eberhara eberhara force-pushed the feature/expose-engine-reporting-http-agent branch from cdcd69d to bd6f961 Compare October 25, 2018 14:42
@eberhara
Copy link
Contributor Author

@abernix

@eberhara
Copy link
Contributor Author

engine: {
  apiKey: 'foo',
  requestAgent: proxyUrl ? new HttpsProxyAgent(proxyUrl) : undefined
},

and it works like a charm!

@eberhara eberhara force-pushed the feature/expose-engine-reporting-http-agent branch from bd6f961 to 831ad90 Compare October 26, 2018 11:48
packages/apollo-engine-reporting/src/agent.ts Outdated Show resolved Hide resolved
packages/apollo-server-env/src/fetch.d.ts Outdated Show resolved Hide resolved
@eberhara eberhara force-pushed the feature/expose-engine-reporting-http-agent branch from 831ad90 to a94672a Compare October 26, 2018 13:07
@eberhara eberhara force-pushed the feature/expose-engine-reporting-http-agent branch from a94672a to f66f797 Compare October 26, 2018 13:12
@eberhara
Copy link
Contributor Author

eberhara commented Oct 26, 2018

@abernix updated! forgot that true wasn't a valid option.

@eberhara
Copy link
Contributor Author

So the codecov check did not pass, however it is complaining about a file that I did not even touch.

@abernix abernix merged commit b640be4 into apollographql:master Oct 26, 2018
@abernix abernix added this to the Release 2.2.0 milestone Oct 26, 2018
@abernix
Copy link
Member

abernix commented Oct 26, 2018

This should be published as 2.2.0-alpha.1!

@yongnicholaskim
Copy link

@eberhara Where is your example code:

engine: {
  apiKey: 'foo',
  requestAgent: proxyUrl ? new HttpsProxyAgent(proxyUrl) : undefined
},

located? In the apollo.config.js? Or can it go in my server.js? Because I'd like to use process.env.

engine: {
  apiKey: 'foo',
  schemaTag: "dev-test-proxy",
  requestAgent: process.env.proxyUrl ? new HttpsProxyAgent(process.env.proxyUrl) : false
}

@abernix abernix removed this from the Release 2.x milestone Jun 28, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 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

Successfully merging this pull request may close these issues.

[apollo-engine-reporting] Support proxy servers
4 participants