UNPKG

1 kBTypeScriptView Raw
1import { GraphQLSchema } from '../type/schema';
2import { GraphQLType, GraphQLCompositeType } from '../type/definition';
3
4/**
5 * Provided two types, return true if the types are equal (invariant).
6 */
7export function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean;
8
9/**
10 * Provided a type and a super type, return true if the first type is either
11 * equal or a subset of the second super type (covariant).
12 */
13export function isTypeSubTypeOf(
14 schema: GraphQLSchema,
15 maybeSubType: GraphQLType,
16 superType: GraphQLType,
17): boolean;
18
19/**
20 * Provided two composite types, determine if they "overlap". Two composite
21 * types overlap when the Sets of possible concrete types for each intersect.
22 *
23 * This is often used to determine if a fragment of a given type could possibly
24 * be visited in a context of another type.
25 *
26 * This function is commutative.
27 */
28export function doTypesOverlap(
29 schema: GraphQLSchema,
30 typeA: GraphQLCompositeType,
31 typeB: GraphQLCompositeType,
32): boolean;