"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.introspectionFromSchema=introspectionFromSchema;var_invariant=_interopRequireDefault(require("../jsutils/invariant"));var_isPromise=_interopRequireDefault(require("../jsutils/isPromise"));var_parser=require("../language/parser");var_execute=require("../execution/execute");var_introspectionQuery=require("./introspectionQuery");function_interopRequireDefault(obj){returnobj&&obj.__esModule?obj:{default:obj};}/** * Build an IntrospectionQuery from a GraphQLSchema * * IntrospectionQuery is useful for utilities that care about type and field * relationships, but do not need to traverse through those relationships. * * This is the inverse of buildClientSchema. The primary use case is outside * of the server context, for instance when doing schema comparisons. */functionintrospectionFromSchema(schema,options){varqueryAST=(0,_parser.parse)((0,_introspectionQuery.getIntrospectionQuery)(options));varresult=(0,_execute.execute)(schema,queryAST);/* istanbul ignore next */!(0,_isPromise.default)(result)&&!result.errors&&result.data||(0,_invariant.default)(0);returnresult.data;}