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