Skip to content

Fix order of .env loading#815

Merged
trevor-scheer merged 1 commit intomasterfrom
trevor/fix-env-loading
Dec 7, 2018
Merged

Fix order of .env loading#815
trevor-scheer merged 1 commit intomasterfrom
trevor/fix-env-loading

Conversation

@trevor-scheer
Copy link
Copy Markdown
Contributor

This PR resolves an issue for configless approaches.

A simple reproduction can be achieved by:

// .env
ENGINE_API_KEY=...

$ npx apollo service:push --endpoint=<...>

  ✔ Loading Apollo Project
  ✖ Uploading service to Engine
    → No service found to link to Engine

Cause
This is because the name was being required before loading the env variables, causing an error to be thrown.

Solution
Load the env config earlier in the configuration process so the service name can be inferred if it isn't provided.

Load the env file earlier during configuration in order to infer the service name before it's required.
@trevor-scheer trevor-scheer merged commit 16c7051 into master Dec 7, 2018
@meatherly meatherly mentioned this pull request Dec 15, 2018
3 tasks
JakeDawkins pushed a commit that referenced this pull request Jan 16, 2019
Load the env file earlier during configuration in order to infer the service name before it's required.
@trevor-scheer trevor-scheer deleted the trevor/fix-env-loading branch April 2, 2019 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant