UNPKG

773 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var isValidPath = require("is-valid-path");
4var graphql_1 = require("graphql");
5var SchemaFromString = /** @class */ (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}());
25exports.SchemaFromString = SchemaFromString;
26//# sourceMappingURL=schema-from-string.js.map
\No newline at end of file