1 | "use strict";
|
2 | var graphql_1 = require("graphql");
|
3 | var fs = require("fs");
|
4 | exports.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 | };
|
12 | exports.loadDocumentsSources = function (filePaths) {
|
13 | return graphql_1.concatAST(filePaths.map(exports.loadFileContent));
|
14 | };
|
15 |
|
\ | No newline at end of file |