1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var graphql_codegen_core_1 = require("graphql-codegen-core");
|
4 | var graphql_tag_pluck_1 = require("graphql-tag-pluck");
|
5 | function 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 | }
|
16 | exports.extractDocumentStringFromCodeFile = extractDocumentStringFromCodeFile;
|
17 |
|
\ | No newline at end of file |