UNPKG

1.04 kBTypeScriptView Raw
1import type { GraphQLCompositeType, GraphQLType } from '../type/definition';
2import type { GraphQLSchema } from '../type/schema';
3/**
4 * Provided two types, return true if the types are equal (invariant).
5 */
6export declare function isEqualType(
7 typeA: GraphQLType,
8 typeB: GraphQLType,
9): boolean;
10/**
11 * Provided a type and a super type, return true if the first type is either
12 * equal or a subset of the second super type (covariant).
13 */
14export declare function isTypeSubTypeOf(
15 schema: GraphQLSchema,
16 maybeSubType: GraphQLType,
17 superType: GraphQLType,
18): boolean;
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 declare function doTypesOverlap(
29 schema: GraphQLSchema,
30 typeA: GraphQLCompositeType,
31 typeB: GraphQLCompositeType,
32): boolean;