UNPKG

617 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var graphql_codegen_core_1 = require("graphql-codegen-core");
4var graphql_tag_pluck_1 = require("graphql-tag-pluck");
5function extractDocumentStringFromCodeFile(source) {
6 try {
7 var parsed = graphql_codegen_core_1.parse(source.body);
8 if (parsed) {
9 return source.body;
10 }
11 }
12 catch (e) {
13 return graphql_tag_pluck_1.default.fromFile.sync(source.name) || null;
14 }
15}
16exports.extractDocumentStringFromCodeFile = extractDocumentStringFromCodeFile;
17//# sourceMappingURL=document-finder.js.map
\No newline at end of file