fix when engine api key is not defined

This commit is contained in:
Eric Burel 2018-10-05 16:03:54 +02:00
parent 6384bbb12b
commit b9b1b96a6e

View file

@ -3,6 +3,8 @@ import { getSetting } from '../../modules/settings.js';
export const engineApiKey = process.env.ENGINE_API_KEY || getSetting('apolloEngine.apiKey');
// options now available:
// @see https://www.apollographql.com/docs/apollo-server/api/apollo-server.html#EngineReportingOptions
export const engineConfig = {
export const engineConfig = engineApiKey
? {
apiKey: engineApiKey
};
}
: undefined;