UNPKG

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