From fc8646753864957a52ab081f9baa13a1a552e1ed Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Tue, 29 Jan 2019 10:23:52 +0200 Subject: [PATCH 1/2] Remove `willStart` from `apollo-server`, already called via `...-express`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the request pipeline was initially introduced, the integrations had yet to be updated to call the new life-cycle events. Now, the integrations have all caught up, but `apollo-server` is still calling `willStart`, despite the fact that its dependency which provides the actual server implementation — `apollo-server-express` – is _also_ calling it, resulting in double invocation of this event. I suspect some follow-up work should guard against this possibility, but for now this should remove the duplication. --- packages/apollo-server/src/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/apollo-server/src/index.ts b/packages/apollo-server/src/index.ts index 3daae6d646b..e92623fb9ee 100644 --- a/packages/apollo-server/src/index.ts +++ b/packages/apollo-server/src/index.ts @@ -78,8 +78,6 @@ export class ApolloServer extends ApolloServerBase { // Listen takes the same arguments as http.Server.listen. public async listen(...opts: Array): Promise { - await this.willStart(); - // This class is the easy mode for people who don't create their own express // object, so we have to create it. const app = express(); From a84a572701693d11ebb7608ca7e020b7549ee3de Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Tue, 29 Jan 2019 11:28:19 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md for #2239. Ref: https://github.com/apollographql/apollo-server/pull/2239 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a494b08d537..4fe1eb5b39d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### vNEXT +- `apollo-server` (only): Stop double-invocation of `serverWillStart` life-cycle event. (More specific integrations - e.g. Express, Koa, Hapi, etc. - were unaffected.) [PR #2239](https://github.com/apollographql/apollo-server/pull/2239) + ### v2.3.2 - Switch from `json-stable-stringify` to `fast-json-stable-stringify`. [PR #2065](https://github.com/apollographql/apollo-server/pull/2065)