Skip to content

Commit

Permalink
Merge pull request #2850 from apollographql/chang/fix/restore-engine-…
Browse files Browse the repository at this point in the history
…false-no-env

fix: restore allow setting `engine: false` to ignore env var
  • Loading branch information
cheapsteak committed Jun 21, 2019
2 parents cfa7a6c + 639476a commit 06df626
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- `apollo-federation`: Preserve docstrings in SDL of federated services. [PR #2830](https://github.com/apollographql/apollo-server/pull/2830)
- `apollo-engine-reporting`: Set `forbiddenOperation` and `registeredOperation` later in the request lifecycle [PR #2828](https://github.com/apollographql/apollo-server/pull/2828)
- `apollo-server-core`: Add queryHash to GraphQLExecutor for federation [PR #2822](https://github.com/apollographql/apollo-server/pull/2822)
- `apollo-server-core`: fix setting `engine: false` should ignore `ENGINE_API_KEY` in environment variable [PR #2850](https://github.com/apollographql/apollo-server/pull/2850) (a regression introduced in 2.6.0)

### v2.6.2

Expand Down
4 changes: 3 additions & 1 deletion packages/apollo-server-core/src/ApolloServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ const NoIntrospection = (context: ValidationContext) => ({

function getEngineApiKey(engine: Config['engine']): string | undefined {
const keyFromEnv = process.env.ENGINE_API_KEY || '';
if (typeof engine === 'object' && engine.apiKey) {
if (engine === false) {
return;
} else if (typeof engine === 'object' && engine.apiKey) {
return engine.apiKey;
} else if (keyFromEnv) {
return keyFromEnv;
Expand Down

0 comments on commit 06df626

Please sign in to comment.