import { GraphQLInputType, GraphQLList, GraphQLNamedType, GraphQLNonNull, GraphQLType } from 'graphql'; import { DynamicInputMethodDef, DynamicOutputMethodDef } from '../dynamicMethod'; import { DynamicOutputPropertyDef } from '../dynamicProperty'; import { NexusPlugin } from '../plugin'; import { AllInputTypes, GetGen } from '../typegenTypeHelpers'; import { PrintedGenTyping, PrintedGenTypingImport } from '../utils'; import { NexusArgDef } from './args'; import { NexusEnumTypeDef } from './enumType'; import { NexusExtendInputTypeDef } from './extendInputType'; import { NexusExtendTypeDef } from './extendType'; import { NexusInputObjectTypeDef } from './inputObjectType'; import { NexusInterfaceTypeDef } from './interfaceType'; import { NexusListDef } from './list'; import { NexusNonNullDef } from './nonNull'; import { NexusNullDef } from './nullable'; import { NexusObjectTypeDef } from './objectType'; import { NexusScalarTypeDef } from './scalarType'; import { NexusUnionTypeDef } from './unionType'; import { NexusTypes, NexusWrappedSymbol } from './_types'; export declare type AllNexusNamedInputTypeDefs = NexusInputObjectTypeDef | NexusEnumTypeDef | NexusScalarTypeDef | Exclude | GraphQLNonNull>; export declare type AllNexusInputTypeDefs = AllNexusNamedInputTypeDefs | NexusListDef | NexusNonNullDef | NexusNullDef | GraphQLList | GraphQLNonNull; export declare type AllNexusNamedOutputTypeDefs = NexusObjectTypeDef | NexusInterfaceTypeDef | NexusUnionTypeDef | NexusEnumTypeDef | NexusScalarTypeDef; export declare type AllNexusOutputTypeDefs = AllNexusNamedOutputTypeDefs | NexusListDef | NexusNonNullDef | NexusNullDef; export declare type AllNexusNamedTypeDefs = AllNexusNamedInputTypeDefs | AllNexusNamedOutputTypeDefs; export declare type AllNexusTypeDefs = AllNexusOutputTypeDefs | AllNexusInputTypeDefs; export declare type NexusListableTypes = AllNamedTypeDefs | NexusArgDef | NexusListDef | NexusNonNullDef | NexusNullDef | GraphQLType; export declare type NexusNonNullableTypes = AllNamedTypeDefs | NexusListDef | NexusArgDef; export declare type NexusNullableTypes = AllNamedTypeDefs | NexusListDef | NexusArgDef; export declare type AllNamedTypeDefs = GetGen<'allNamedTypes', string> | AllNexusNamedTypeDefs; export declare type AllNexusNamedArgsDefs = T | NexusArgDef | AllNexusNamedInputTypeDefs | GraphQLInputType; export declare type AllNexusArgsDefs = AllNexusNamedArgsDefs | NexusListDef | NexusNonNullDef | NexusNullDef | GraphQLInputType; export declare const isNexusTypeDef: (obj: any) => obj is { [NexusWrappedSymbol]: NexusTypes; }; export declare function isNexusStruct(obj: any): obj is { [NexusWrappedSymbol]: NexusTypes; }; export declare function isNexusNamedTypeDef(obj: any): obj is AllNexusNamedTypeDefs; export declare function isNexusListTypeDef(obj: any): obj is NexusListDef; export declare function isNexusNonNullTypeDef(obj: any): obj is NexusNonNullDef; export declare function isNexusNullTypeDef(obj: any): obj is NexusNullDef; export declare function isNexusWrappingType(obj: any): obj is NexusListDef | NexusNullDef | NexusNonNullDef; export declare function isNexusExtendInputTypeDef(obj: any): obj is NexusExtendInputTypeDef; export declare function isNexusExtendTypeDef(obj: any): obj is NexusExtendTypeDef; export declare function isNexusEnumTypeDef(obj: any): obj is NexusEnumTypeDef; export declare function isNexusInputObjectTypeDef(obj: any): obj is NexusInputObjectTypeDef; export declare function isNexusObjectTypeDef(obj: any): obj is NexusObjectTypeDef; export declare function isNexusScalarTypeDef(obj: any): obj is NexusScalarTypeDef; export declare function isNexusUnionTypeDef(obj: any): obj is NexusUnionTypeDef; export declare function isNexusInterfaceTypeDef(obj: any): obj is NexusInterfaceTypeDef; export declare function isNexusArgDef(obj: any): obj is NexusArgDef; export declare function isNexusDynamicOutputProperty(obj: any): obj is DynamicOutputPropertyDef; export declare function isNexusDynamicOutputMethod(obj: any): obj is DynamicOutputMethodDef; export declare function isNexusDynamicInputMethod(obj: any): obj is DynamicInputMethodDef; export declare function isNexusPrintedGenTyping(obj: any): obj is PrintedGenTyping; export declare function isNexusPrintedGenTypingImport(obj: any): obj is PrintedGenTypingImport; export declare function isNexusPlugin(obj: any): obj is NexusPlugin; export declare type NexusWrapKind = 'NonNull' | 'Null' | 'List'; export declare type NexusFinalWrapKind = 'NonNull' | 'List'; export declare function unwrapGraphQLDef(typeDef: GraphQLType): { namedType: GraphQLNamedType; wrapping: NexusFinalWrapKind[]; }; /** * Unwraps any wrapped Nexus or GraphQL types, * turning into a list of wrapping */ export declare function unwrapNexusDef(typeDef: AllNexusTypeDefs | AllNexusArgsDefs | GraphQLType | string): { namedType: AllNexusNamedTypeDefs | AllNexusArgsDefs | GraphQLNamedType | string; wrapping: NexusWrapKind[]; }; /** * Takes the named type, and applies any of the NexusFinalWrapKind * to create a properly wrapped GraphQL type. */ export declare function rewrapAsGraphQLType(baseType: GraphQLNamedType, wrapping: NexusFinalWrapKind[]): GraphQLType; /** * Apply the wrapping consistently to the arg `type` * * nonNull(list(stringArg())) -> arg({ type: nonNull(list('String')) }) */ export declare function normalizeArgWrapping(argVal: AllNexusArgsDefs): NexusArgDef; /** * Applies the ['List', 'NonNull', 'Nullable'] * @param toWrap * @param wrapping */ export declare function applyNexusWrapping(toWrap: any, wrapping: NexusWrapKind[]): any; /** * Takes the "nonNullDefault" value, the chained wrapping, and the field wrapping, * to determine the proper list of wrapping to apply to the field */ export declare function finalizeWrapping(nonNullDefault: boolean, typeWrapping: NexusWrapKind[] | ReadonlyArray, chainWrapping?: NexusWrapKind[]): NexusFinalWrapKind[];