UNPKG

552 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var graphql_1 = require("graphql");
4exports.validateIntrospection = function (schema) {
5 if (!schema.__schema) {
6 throw new Error('Invalid schema provided!');
7 }
8};
9function introspectionToGraphQLSchema(introspectionQuery) {
10 exports.validateIntrospection(introspectionQuery);
11 return graphql_1.buildClientSchema(introspectionQuery);
12}
13exports.introspectionToGraphQLSchema = introspectionToGraphQLSchema;
14//# sourceMappingURL=introspection-to-schema.js.map
\No newline at end of file