github-pages-deploy-action/node_modules/graphql-config/lib/getGraphQLConfig.js

19 lines
868 B
JavaScript
Raw Normal View History

2020-03-07 11:45:40 +08:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("./utils");
var findGraphQLConfigFile_1 = require("./findGraphQLConfigFile");
var GraphQLConfig_1 = require("./GraphQLConfig");
function getGraphQLConfig(rootDir) {
if (rootDir === void 0) { rootDir = process.cwd(); }
var configPath = findGraphQLConfigFile_1.findGraphQLConfigFile(rootDir);
var config = utils_1.readConfig(configPath);
utils_1.validateConfig(config);
return new GraphQLConfig_1.GraphQLConfig(config, configPath);
}
exports.getGraphQLConfig = getGraphQLConfig;
function getGraphQLProjectConfig(rootDir, projectName) {
if (projectName === void 0) { projectName = process.env.GRAPHQL_CONFIG_PROJECT; }
return getGraphQLConfig(rootDir).getProjectConfig(projectName);
}
exports.getGraphQLProjectConfig = getGraphQLProjectConfig;