UNPKG

614 BTypeScriptView Raw
1import { GraphQLError } from '../error/GraphQLError';
2import { GraphQLSchema } from './schema';
3
4/**
5 * Implements the "Type Validation" sub-sections of the specification's
6 * "Type System" section.
7 *
8 * Validation runs synchronously, returning an array of encountered errors, or
9 * an empty array if no errors were encountered and the Schema is valid.
10 */
11export function validateSchema(
12 schema: GraphQLSchema,
13): ReadonlyArray<GraphQLError>;
14
15/**
16 * Utility function which asserts a schema is valid by throwing an error if
17 * it is invalid.
18 */
19export function assertValidSchema(schema: GraphQLSchema): void;