⚠️ This is for the JavaScriptapollo
CLI, usually installed withnpm install apollo
ornpx
, not for any other Apollo CLI
-
If it's not already installed (present in the project's
package.json
), install theapollo
CLI directly into thedevDependencies
of the project.npm install --save-dev apollo
-
Install the
global-agent
package into thedevDependencies
of the project.npm install --save-dev global-agent
-
Invoke the
apollo
CLI, in a similar fashion to how you might invoke it in a project withnpx
, but with aGLOBAL_AGENT_HTTP_PROXY
environment variable which is enabled by the requiring of the of theglobal-agent/bootstrap
module from theglobal-agent
package we installed previously.Important: This particular example uses
apollo service:check
and its options, but the same pattern should work for other commands, likeapollo service:push
, etc. This command is split over multiple lines using the trailing\
characters on the lines below, but it can also be issued as a single line, though the slash (\
) characters should be removed. See theREADME
forglobal-agent
for all available environment variable options (e.g., for configuring hosts that should not be proxied, etc.).APOLLO_KEY=your-api-key \ GLOBAL_AGENT_HTTP_PROXY=http://proxy-hostname:proxy-port \ npx -n '-r global-agent/bootstrap' \ apollo service:check \ --serviceName <service-name> \ --endpoint <endpointUrl> \ --serviceURL <serviceUrl> \ --variant <variant>