UNPKG

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