mirror of
https://github.com/vale981/apollo-server
synced 2025-03-14 23:06:40 -04:00
![]() 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.). |
||
---|---|---|
.. | ||
__tests__ | ||
ApolloServer.ts | ||
index.ts | ||
microApollo.ts | ||
types.ts |