UNPKG

909 BTypeScriptView Raw
1import { GraphQLSchema, GraphQLError, Source } from 'graphql';
2export interface InvalidDocument {
3 source: Source;
4 errors: GraphQLError[];
5 deprecated: GraphQLError[];
6}
7export interface ValidateOptions {
8 /**
9 * Fails on duplicated fragment names
10 * @default true
11 */
12 strictFragments?: boolean;
13 /**
14 * Fails on deprecated usage
15 * @default true
16 */
17 strictDeprecated?: boolean;
18 /**
19 * Works only with combination of `apollo`
20 * @default false
21 */
22 keepClientFields?: boolean;
23 /**
24 * Supports Apollo directives (`@client` and `@connection`)
25 * @default false
26 */
27 apollo?: boolean;
28 /**
29 * Fails when operation depth exceeds maximum depth
30 * @default false
31 */
32 maxDepth?: number;
33}
34export declare function validate(schema: GraphQLSchema, sources: Source[], options?: ValidateOptions): InvalidDocument[];