1234567891011121314151617181920212223 |
- import invariant from '../jsutils/invariant';
- import isPromise from '../jsutils/isPromise';
- import { parse } from '../language/parser';
- import { execute } from '../execution/execute';
- import { getIntrospectionQuery } from './introspectionQuery';
- export function introspectionFromSchema(schema, options) {
- var queryAST = parse(getIntrospectionQuery(options));
- var result = execute(schema, queryAST);
-
- !isPromise(result) && !result.errors && result.data || invariant(0);
- return result.data;
- }
|