apollo-server/packages/apollo-server-micro/src
Jesse Rosenberger aae212f869 Triggers for newly introduced serverWillStart lifecycle hooks.
This commit follows-up on #1795, which introduced the new request pipeline, and
implements the triggers for its new life-cycle hooks within the various
integration packages.  Previously, the only implementation was within the
`apollo-server` package and didn't get triggered for those invoking the
`applyMiddleware` method on integrations (e.g. `apollo-server-express`,
`...-hapi` and `...-koa`).

While in an ideal world, ALL existing `applyMiddleware` functions would be
marked as `async` functions and allow us to `await ApolloServer#willStart`,
in practice the only `applyMiddleware` which is currently `async` is the one
within the Hapi implementation.  Therefore, we'll instead kick off the
`willStart` lifecycle hook as soon as `applyMiddleware` is started, return
as quickly as we have before and then (essentially) yield the completion of
Apollo Server's `willStart` prior to serving the first request — thus
ensuring the completion of server-startup activities.

Similarly, we'll do the same for `createHandler` methods on integrations
which don't utilize Node.js server frameworks but don't have `async`
handlers (e.g. AWS, Lambda, etc.).
2018-10-26 15:07:13 +03:00
..
__tests__ Consistently leave out explicit tsconfig.json when referring to TypeScript project 2018-10-12 13:34:07 +02:00
ApolloServer.ts Triggers for newly introduced serverWillStart lifecycle hooks. 2018-10-26 15:07:13 +03:00
index.ts Fix and Export Extension and Playground Types (#1360) 2018-07-16 15:49:20 -07:00
microApollo.ts Fix typing issues in handler arguments and introduce generic type 2018-10-12 10:46:07 +02:00
types.ts Apollo Server 2 Micro integration (#1279) 2018-07-05 11:40:15 -07:00