import type { GraphQLFieldConfigArgumentMap, GraphQLArgumentConfig, GraphQLOutputType, GraphQLFieldConfig, GraphQLInputType, GraphQLResolveInfo, GraphQLFieldResolver } from './graphql'; import { ObjectTypeComposer } from './ObjectTypeComposer'; import type { ObjectTypeComposerArgumentConfigMap, ObjectTypeComposerArgumentConfigMapDefinition, ObjectTypeComposerArgumentConfig, ObjectTypeComposerArgumentConfigDefinition, ObjectTypeComposerArgumentConfigAsObjectDefinition } from './ObjectTypeComposer'; import { InputTypeComposer } from './InputTypeComposer'; import { SchemaComposer } from './SchemaComposer'; import type { ProjectionType } from './utils/projection'; import { TypeInPath } from './utils/typeByPath'; import type { ComposeOutputType, ComposeOutputTypeDefinition, ComposeNamedOutputType, ComposeNamedInputType, ComposeInputTypeDefinition } from './utils/typeHelpers'; import type { Thunk, ThunkWithSchemaComposer, Extensions, Directive } from './utils/definitions'; export declare type ResolverKinds = 'query' | 'mutation' | 'subscription'; export declare type ResolverDefinition = { type?: ThunkWithSchemaComposer> | ComposeOutputTypeDefinition | Readonly>, SchemaComposer>; resolve?: ResolverRpCb; args?: ObjectTypeComposerArgumentConfigMapDefinition; name?: string; displayName?: string; kind?: ResolverKinds; description?: string; deprecationReason?: string | null; projection?: ProjectionType; parent?: Resolver; extensions?: Extensions; directives?: Directive[]; }; export declare type ResolverResolveParams = { source: TSource; args: TArgs; context: TContext; info: GraphQLResolveInfo; projection: Partial; [opt: string]: any; }; export declare type ResolverFilterArgFn = (query: any, value: any, resolveParams: ResolverResolveParams) => any; export declare type ResolverFilterArgConfigDefinition = { name: string; type: ComposeInputTypeDefinition; description?: string | null | void; query?: ResolverFilterArgFn; filterTypeNameFallback?: string; defaultValue?: any; }; export declare type ResolverSortArgFn = (resolveParams: ResolverResolveParams) => any; export declare type ResolverSortArgConfig = { name: string; sortTypeNameFallback?: string; value: { [key: string]: any; } | ResolverSortArgFn | string | number | boolean | any[]; deprecationReason?: string | null; description?: string | null; }; export declare type ResolverWrapCb = (newResolver: Resolver, prevResolver: Resolver) => Resolver; export declare type ResolverRpCb = (resolveParams: ResolverResolveParams) => Promise | any; export declare type ResolverRpCbPartial = (resolveParams: Partial>) => Promise | any; export declare type ResolverNextRpCb = (next: ResolverRpCb) => ResolverRpCb; export declare type ResolverDebugOpts = { showHidden?: boolean; depth?: number; colors?: boolean; }; export declare type ResolverMiddleware = (resolve: (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => any, source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => any; export declare class Resolver { schemaComposer: SchemaComposer; type: ComposeOutputType; args: ObjectTypeComposerArgumentConfigMap; name: string; displayName: string | undefined; kind: ResolverKinds | undefined; description: string | undefined; deprecationReason: string | null | undefined; projection: ProjectionType; parent: Resolver | undefined; extensions: Extensions | undefined; directives: Directive[] | undefined; resolve: ResolverRpCbPartial; constructor(opts: ResolverDefinition, schemaComposer: SchemaComposer); getType(): GraphQLOutputType; getTypeName(): string; getTypeComposer(): ComposeNamedOutputType; getOTC(): ObjectTypeComposer; setType(typeDef: ThunkWithSchemaComposer> | ComposeOutputTypeDefinition | Readonly>, SchemaComposer>): Resolver; hasArg(argName: string): boolean; getArg(argName: string): ObjectTypeComposerArgumentConfig; getArgConfig(argName: string): GraphQLArgumentConfig; getArgType(argName: string): GraphQLInputType; getArgTypeName(fieldName: string): string; getArgs(): ObjectTypeComposerArgumentConfigMap; getArgNames(): string[]; setArgs(args: ObjectTypeComposerArgumentConfigMapDefinition): Resolver; setArg(argName: string, argConfig: ObjectTypeComposerArgumentConfigDefinition): this; setArgType(argName: string, typeDef: Thunk): this; extendArg(argName: string, partialArgConfig: Partial): this; addArgs(newArgs: ObjectTypeComposerArgumentConfigMapDefinition): this; removeArg(argNameOrArray: string | string[]): this; removeOtherArgs(argNameOrArray: string | string[]): this; reorderArgs(names: string[]): this; getArgTC(argName: string): ComposeNamedInputType; getArgITC(argName: string): InputTypeComposer; isArgNonNull(argName: string): boolean; makeArgNonNull(argNameOrArray: string | string[]): this; makeRequired(argNameOrArray: string | string[]): this; makeArgNullable(argNameOrArray: string | string[]): this; makeOptional(argNameOrArray: string | string[]): this; isArgPlural(argName: string): boolean; makeArgPlural(argNameOrArray: string | string[]): this; makeArgNonPlural(argNameOrArray: string | string[]): this; cloneArg(argName: string, newTypeName: string): this; addFilterArg(opts: ResolverFilterArgConfigDefinition): this; addSortArg(opts: ResolverSortArgConfig): this; getResolve(): ResolverRpCb; setResolve(resolve: ResolverRpCb): this; withMiddlewares(middlewares: Array>): Resolver; wrap(cb?: ResolverWrapCb | null, newResolverOpts?: Partial>): Resolver; wrapResolve(cb: ResolverNextRpCb, wrapperName?: string): Resolver; wrapArgs(cb: (prevArgs: GraphQLFieldConfigArgumentMap) => ObjectTypeComposerArgumentConfigMapDefinition, wrapperName?: string): Resolver; wrapCloneArg(argName: string, newTypeName: string): Resolver; wrapType(cb: (prevType: ComposeOutputType) => ComposeOutputTypeDefinition, wrapperName?: string): Resolver; getFieldConfig(opts?: { projection?: ProjectionType; }): GraphQLFieldConfig; getFieldResolver(opts?: { projection?: ProjectionType; }): GraphQLFieldResolver; getKind(): ResolverKinds | void; setKind(kind: string): this; getDescription(): string | undefined; setDescription(description: string | undefined): this; getDeprecationReason(): string | undefined | null; setDeprecationReason(reason: string | undefined): this; get(path: string | string[]): TypeInPath | void; clone(opts?: Partial>): Resolver; cloneTo(anotherSchemaComposer: SchemaComposer, cloneMap?: Map): Resolver; getExtensions(): Extensions; setExtensions(extensions: Extensions): this; extendExtensions(extensions: Extensions): this; clearExtensions(): this; getExtension(extensionName: string): unknown; hasExtension(extensionName: string): boolean; setExtension(extensionName: string, value: unknown): this; removeExtension(extensionName: string): this; getNestedName(): string; toString(): string; setDisplayName(name: string): this; toDebugStructure(): Record; debugExecTime(): Resolver; debugParams(filterPaths?: string | string[] | undefined | null, opts?: ResolverDebugOpts): Resolver; debugPayload(filterPaths?: string | string[] | undefined | null, opts?: ResolverDebugOpts): Resolver; debug(filterDotPaths?: { params?: string | string[] | undefined | null; payload?: string | string[] | undefined | null; }, opts?: ResolverDebugOpts): Resolver; } //# sourceMappingURL=Resolver.d.ts.map