const server = new ApolloServer({
typeDefs,
resolvers,
onHealthCheck: () => { return new Promise((resolve, reject) => { // Replace the `true` in this conditional with more specific checks! if (true) { resolve(); } else { reject(); } }); },});
Extend ReactionAPICore constructor to allow for additional option key ApolloServerOptions.
And then pass those options down to the new ApolloServer call.
If feature is approved we can start working on it asap.
Use case: We want to add custom health check for apollo server as described here: https://www.apollographql.com/docs/apollo-server/monitoring/health-checks/
Description:
Here is definition for ReactionAPICore: https://github.com/reactioncommerce/api-core/blob/trunk/src/ReactionAPICore.js#L110 Here new ApolloServer is created: https://github.com/reactioncommerce/api-core/blob/de2e924ae68247c08f690fbbd3fc9f678f4f45ec/src/createApolloServer.js#L73
Solution:
Extend ReactionAPICore constructor to allow for additional option key
ApolloServerOptions
. And then pass those options down to thenew ApolloServer
call.If feature is approved we can start working on it asap.