text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  const config_1 = require("../../config");
  const endpoint_1 = require("./endpoint");
  function federationInfoProviderFromConfig(config) {
      if (config_1.isServiceConfig(config)) {
          if (config.service.endpoint) {
              return new endpoint_1.EndpointFederationInfoProvider(config.service.endpoint);
          }
          throw new Error("You must provide a service endpoint to use the federation info provider");
      }
      if (config_1.isClientConfig(config)) {
          throw new Error("No federation info provider was created, because client projects are unsupported. For more information, please refer to https://bit.ly/2ByILPj");
      }
      throw new Error("No federation info provider was created, because the project type was unable to be resolved from your config. Please add a service config to use the SDL provider. For more information, please refer to https://bit.ly/2ByILPj");
  }
  exports.federationInfoProviderFromConfig = federationInfoProviderFromConfig;
  //# sourceMappingURL=index.js.map