Skip to content

Commit

Permalink
Remove willStart from apollo-server, already called via `…-expres…
Browse files Browse the repository at this point in the history
…s`. (#2239)

* Remove `willStart` from `apollo-server`, already called via `...-express`.

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.

* Update CHANGELOG.md for #2239.

Ref: #2239
  • Loading branch information
abernix committed Jan 29, 2019
1 parent cd674aa commit db39aa5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -2,7 +2,8 @@

### vNEXT

- Avoid traversing `graphql-uploads` module tree in run-time environments which aren't Node.js. [PR #2235](https://github.com/apollographql/apollo-server/pull/2235)
- `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)
- Avoid traversing `graphql-upload` module tree in run-time environments which aren't Node.js. [PR #2235](https://github.com/apollographql/apollo-server/pull/2235)

### v2.3.2

Expand Down
2 changes: 0 additions & 2 deletions packages/apollo-server/src/index.ts
Expand Up @@ -78,8 +78,6 @@ export class ApolloServer extends ApolloServerBase {

// Listen takes the same arguments as http.Server.listen.
public async listen(...opts: Array<any>): Promise<ServerInfo> {
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();
Expand Down

0 comments on commit db39aa5

Please sign in to comment.