import { getSetting } from '../../modules/settings.js';
// see https://github.com/apollographql/apollo-cache-control
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 = engineApiKey
  ? {
      apiKey: engineApiKey,
    }
  : undefined;

import { getSetting } from '../../modules/settings.js';
// @see https://www.apollographql.com/docs/apollo-server/api/apollo-server.html#EngineReportingOptions

let engineConfigObject = getSetting('apolloEngine');

if (!engineConfigObject || !engineConfigObject.apiKey) {
  engineConfigObject = {
    apiKey: process.env.ENGINE_API_KEY,
    schemaTag: process.env.ENGINE_SCHEMA_TAG
  };
}

export const engineConfig = engineConfigObject && engineConfigObject.apiKey ? engineConfigObject : undefined;

Add support for Apollo Engine schemaTag in addition to apiKey
Add support for Apollo Engine schemaTag in addition to apiKey
