"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var from_url_1 = require("./from-url");
var from_json_file_1 = require("./from-json-file");
var from_graphql_file_1 = require("./from-graphql-file");
var loaders = [from_url_1.fromUrl, from_json_file_1.fromJSONFile, from_graphql_file_1.fromGraphQLFile];
function isLoader(loader) {
    return typeof loader !== 'undefined';
}
function loadSchema(pointer) {
    var loader = undefined;
    loaders.some(function (fn) {
        var _loader = fn(pointer);
        if (_loader) {
            loader = _loader;
            return true;
        }
        return false;
    });
    if (isLoader(loader)) {
        return loader();
    }
    throw new Error("Couldn't handle " + pointer);
}
exports.loadSchema = loadSchema;
//# sourceMappingURL=index.js.map