UNPKG

866 BTypeScriptView Raw
1import { IntrospectionQuery } from './introspectionQuery';
2import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema';
3
4interface Options extends GraphQLSchemaValidationOptions {}
5
6/**
7 * Build a GraphQLSchema for use by client tools.
8 *
9 * Given the result of a client running the introspection query, creates and
10 * returns a GraphQLSchema instance which can be then used with all graphql-js
11 * tools, but cannot be used to execute a query, as introspection does not
12 * represent the "resolver", "parse" or "serialize" functions or any other
13 * server-internal mechanisms.
14 *
15 * This function expects a complete introspection result. Don't forget to check
16 * the "errors" field of a server response before calling this function.
17 */
18export function buildClientSchema(
19 introspection: IntrospectionQuery,
20 options?: Options,
21): GraphQLSchema;