1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var graphql_1 = require("graphql");
|
4 | var SchemaFromString = (function () {
|
5 | function SchemaFromString() {
|
6 | }
|
7 | SchemaFromString.prototype.canHandle = function (str) {
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | if (/\.[a-z0-9]+$/i.test(str)) {
|
14 | return false;
|
15 | }
|
16 | try {
|
17 | graphql_1.parse(str);
|
18 | return true;
|
19 | }
|
20 | catch (e) {
|
21 | return false;
|
22 | }
|
23 | };
|
24 | SchemaFromString.prototype.handle = function (str, config, schemaOptions) {
|
25 | return graphql_1.parse(str);
|
26 | };
|
27 | return SchemaFromString;
|
28 | }());
|
29 | exports.SchemaFromString = SchemaFromString;
|
30 |
|
\ | No newline at end of file |