UNPKG

5.42 kBTypeScriptView Raw
1import type { GraphQLType, GraphQLNamedType, GraphQLOutputType, GraphQLInputType } from '../graphql';
2import { ObjectTypeComposer } from '../ObjectTypeComposer';
3import { InputTypeComposer } from '../InputTypeComposer';
4import { ScalarTypeComposer } from '../ScalarTypeComposer';
5import { EnumTypeComposer } from '../EnumTypeComposer';
6import { InterfaceTypeComposer } from '../InterfaceTypeComposer';
7import { UnionTypeComposer } from '../UnionTypeComposer';
8import { NonNullComposer } from '../NonNullComposer';
9import { ListComposer } from '../ListComposer';
10import { ThunkComposer } from '../ThunkComposer';
11import type { TypeAsString } from '../TypeMapper';
12import type { SchemaComposer } from '../SchemaComposer';
13export declare type AnyTypeComposer<TContext> = NamedTypeComposer<TContext> | ListComposer<any> | NonNullComposer<any> | ThunkComposer<any, any>;
14export declare type NamedTypeComposer<TContext> = ObjectTypeComposer<any, TContext> | InputTypeComposer<TContext> | EnumTypeComposer<TContext> | InterfaceTypeComposer<any, TContext> | UnionTypeComposer<any, TContext> | ScalarTypeComposer<TContext>;
15export declare type ComposeNamedOutputType<TContext> = ObjectTypeComposer<any, TContext> | EnumTypeComposer<TContext> | ScalarTypeComposer<TContext> | InterfaceTypeComposer<any, TContext> | UnionTypeComposer<any, TContext>;
16export declare type ComposeOutputType<TContext> = ComposeNamedOutputType<TContext> | NonNullComposer<any> | ListComposer<any> | ThunkComposer<any, GraphQLOutputType>;
17export declare type ComposeOutputTypeDefinition<TContext> = Readonly<ComposeOutputType<TContext>> | Readonly<GraphQLOutputType> | TypeAsString | ReadonlyArray<Readonly<ComposeOutputType<TContext>> | Readonly<GraphQLOutputType> | TypeAsString | ReadonlyArray<Readonly<ComposeOutputType<TContext>> | Readonly<GraphQLOutputType> | TypeAsString>>;
18export declare type ComposeNamedInputType<TContext> = InputTypeComposer<TContext> | EnumTypeComposer<TContext> | ScalarTypeComposer<TContext>;
19export declare type ComposeInputType = ComposeNamedInputType<any> | ThunkComposer<ComposeNamedInputType<any>, GraphQLInputType> | NonNullComposer<ComposeNamedInputType<any> | ThunkComposer<ComposeNamedInputType<any>, GraphQLInputType> | ListComposer<any>> | ListComposer<ComposeNamedInputType<any> | ThunkComposer<ComposeNamedInputType<any>, GraphQLInputType> | ListComposer<any> | NonNullComposer<any>>;
20export declare type ComposeInputTypeDefinition = TypeAsString | Readonly<ComposeInputType> | Readonly<GraphQLInputType> | ReadonlyArray<TypeAsString | Readonly<ComposeInputType> | Readonly<GraphQLInputType> | ReadonlyArray<TypeAsString | Readonly<ComposeInputType> | Readonly<GraphQLInputType>>>;
21export declare function isTypeNameString(str: string): boolean;
22export declare function isWrappedTypeNameString(str: string): boolean;
23export declare function isTypeDefinitionString(str: string): boolean;
24export declare function isSomeOutputTypeDefinitionString(str: string): boolean;
25export declare function isSomeInputTypeDefinitionString(str: string): boolean;
26export declare function isOutputTypeDefinitionString(str: string): boolean;
27export declare function isInputTypeDefinitionString(str: string): boolean;
28export declare function isEnumTypeDefinitionString(str: string): boolean;
29export declare function isScalarTypeDefinitionString(str: string): boolean;
30export declare function isInterfaceTypeDefinitionString(str: string): boolean;
31export declare function isUnionTypeDefinitionString(str: string): boolean;
32export declare function isSomeOutputTypeComposer(type: any): type is ComposeOutputType<any>;
33export declare function isSomeInputTypeComposer(type: any): type is ComposeInputType;
34export declare function isComposeNamedType(type: any): type is NamedTypeComposer<any> | GraphQLNamedType;
35export declare function isComposeType(type: any): type is AnyTypeComposer<any>;
36export declare function isComposeOutputType(type: any): type is ComposeOutputTypeDefinition<any>;
37export declare function isComposeInputType(type: any): type is ComposeInputTypeDefinition;
38export declare type AnyType<TContext> = NamedTypeComposer<TContext> | GraphQLNamedType;
39export declare function isNamedTypeComposer(type: any): type is NamedTypeComposer<any>;
40export declare function isTypeComposer(type: any): type is AnyTypeComposer<any>;
41export declare function getGraphQLType(anyType: any): GraphQLType;
42export declare function getComposeTypeName(type: any, sc: SchemaComposer<any>): string;
43export declare function unwrapTC<TContext>(anyTC: AnyTypeComposer<TContext>): NamedTypeComposer<TContext>;
44export declare function unwrapInputTC(inputTC: ComposeInputType): ComposeNamedInputType<any>;
45export declare function unwrapOutputTC<TContext>(outputTC: ComposeOutputType<TContext>): ComposeNamedOutputType<TContext>;
46export declare function changeUnwrappedTC<TContext, T>(anyTC: T, cb: (tc: NamedTypeComposer<TContext>) => NamedTypeComposer<TContext>): T;
47export declare function replaceTC<T>(anyTC: T, replaceByTC: Readonly<NamedTypeComposer<any>> | ((unwrappedTC: NamedTypeComposer<any>) => NamedTypeComposer<any>)): T;
48export declare function unwrapTypeNameString(str: string): string;
49export declare function cloneTypeTo(type: AnyTypeComposer<any> | TypeAsString | GraphQLType, anotherSchemaComposer: SchemaComposer<any>, cloneMap?: Map<any, any>): AnyTypeComposer<any> | TypeAsString;
50//# sourceMappingURL=typeHelpers.d.ts.map
\No newline at end of file