UNPKG

530 BJavaScriptView Raw
1"use strict";
2var graphql_1 = require("graphql");
3var fs = require("fs");
4exports.loadFileContent = function (filePath) {
5 if (fs.existsSync(filePath)) {
6 return graphql_1.parse(new graphql_1.Source(fs.readFileSync(filePath, 'utf8'), filePath));
7 }
8 else {
9 throw new Error("Document file " + filePath + " does not exists!");
10 }
11};
12exports.loadDocumentsSources = function (filePaths) {
13 return graphql_1.concatAST(filePaths.map(exports.loadFileContent));
14};
15//# sourceMappingURL=document-loader.js.map
\No newline at end of file