import { GraphQLObjectType, GraphQLInputObjectType, GraphQLInterfaceType } from './graphql'; import type { GraphQLFieldConfig, GraphQLOutputType, GraphQLInputType, GraphQLIsTypeOfFn, GraphQLResolveInfo, GraphQLFieldResolver, FieldDefinitionNode, InputValueDefinitionNode } from './graphql'; import { InputTypeComposer } from './InputTypeComposer'; import type { TypeAsString, TypeDefinitionString } from './TypeMapper'; import { InterfaceTypeComposer, InterfaceTypeComposerDefinition, InterfaceTypeComposerThunked } from './InterfaceTypeComposer'; import { Resolver, ResolverDefinition, ResolverNextRpCb, ResolverWrapCb, ResolverMiddleware } from './Resolver'; import { SchemaComposer } from './SchemaComposer'; import { ListComposer } from './ListComposer'; import { NonNullComposer } from './NonNullComposer'; import { ThunkComposer } from './ThunkComposer'; import type { ToInputTypeOpts } from './utils/toInputType'; import { TypeInPath } from './utils/typeByPath'; import { NamedTypeComposer } from './utils/typeHelpers'; import type { ProjectionType } from './utils/projection'; import type { ObjMap, ThunkWithSchemaComposer, Extensions, Directive, DirectiveArgs } from './utils/definitions'; import type { ComposeNamedInputType, ComposeInputType, ComposeInputTypeDefinition, ComposeOutputTypeDefinition, ComposeOutputType, ComposeNamedOutputType } from './utils/typeHelpers'; import { SchemaPrinterOptions } from './utils/schemaPrinter'; export declare type ObjectTypeComposerDefinition = TypeAsString | TypeDefinitionString | ObjectTypeComposerAsObjectDefinition | Readonly> | Readonly; export declare type ObjectTypeComposerAsObjectDefinition = { name: string; interfaces?: null | ThunkWithSchemaComposer>, SchemaComposer>; fields?: ObjectTypeComposerFieldConfigMapDefinition; isTypeOf?: null | GraphQLIsTypeOfFn; description?: string | null; isIntrospection?: boolean; extensions?: Extensions; directives?: Directive[]; }; export declare type ObjectTypeComposerFieldConfigMap = ObjMap>; export declare type ObjectTypeComposerFieldConfigMapDefinition = ObjMap>; export declare type ObjectTypeComposerFieldConfigDefinition = ThunkWithSchemaComposer, SchemaComposer> | ThunkWithSchemaComposer, SchemaComposer>; export declare type ObjectTypeComposerFieldConfigAsObjectDefinition = { type: ThunkWithSchemaComposer | Readonly>, SchemaComposer>; args?: ObjectTypeComposerArgumentConfigMapDefinition; resolve?: GraphQLFieldResolver; subscribe?: GraphQLFieldResolver; deprecationReason?: string | null; description?: string | null; extensions?: Extensions | undefined; directives?: Directive[]; [key: string]: any; }; export declare type ObjectTypeComposerFieldConfig = { type: ComposeOutputType; args?: ObjectTypeComposerArgumentConfigMap; resolve?: GraphQLFieldResolver; subscribe?: GraphQLFieldResolver; deprecationReason?: string | null; description?: string | null; astNode?: FieldDefinitionNode | null; extensions?: Extensions; directives?: Directive[]; [key: string]: any; }; export declare type ObjectTypeComposerArgumentConfigMap> = Record; export declare type ObjectTypeComposerArgumentConfigMapDefinition> = Record; export declare type ObjectTypeComposerArgumentConfigAsObjectDefinition = { type: ThunkWithSchemaComposer>; defaultValue?: any; description?: string | null; deprecationReason?: string | null; extensions?: Extensions; directives?: Directive[]; [key: string]: any; }; export declare type ObjectTypeComposerArgumentConfig = { type: ComposeInputType; defaultValue?: any; description?: string | null; deprecationReason?: string | null; astNode?: InputValueDefinitionNode | null; extensions?: Extensions; directives?: Directive[]; [key: string]: any; }; export declare type ObjectTypeComposerArgumentConfigDefinition = ObjectTypeComposerArgumentConfigAsObjectDefinition | ThunkWithSchemaComposer>; export declare type ObjectTypeComposerRelationMap = { [fieldName: string]: ObjectTypeComposerRelationOpts; }; export declare type ObjectTypeComposerRelationOpts = any> = ObjectTypeComposerRelationOptsWithResolver | ObjectTypeComposerFieldConfigAsObjectDefinition; export declare type ObjectTypeComposerRelationOptsWithResolver = any> = { resolver: ThunkWithSchemaComposer, SchemaComposer>; prepareArgs?: ObjectTypeComposerRelationArgsMapper; projection?: ProjectionType; description?: string | null; deprecationReason?: string | null; catchErrors?: boolean; extensions?: Extensions; directives?: Directive[]; }; export declare type ObjectTypeComposerRelationArgsMapperFn> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => any; export declare type ObjectTypeComposerRelationArgsMapper = Record> = { [argName in keyof TArgs]: { [key: string]: any; } | ObjectTypeComposerRelationArgsMapperFn | null | void | string | number | any[]; }; export declare type ObjectTypeComposerGetRecordIdFn = (source: TSource, args?: TArgs, context?: TContext) => string; export declare type ObjectTypeComposerThunked = ObjectTypeComposer | ThunkComposer, GraphQLObjectType>; export declare class ObjectTypeComposer { schemaComposer: SchemaComposer; _gqType: GraphQLObjectType; _gqcInputTypeComposer: undefined | InputTypeComposer; _gqcResolvers: undefined | Map>; _gqcGetRecordIdFn: undefined | ObjectTypeComposerGetRecordIdFn; _gqcRelations: undefined | ObjectTypeComposerRelationMap; _gqcFields: ObjectTypeComposerFieldConfigMap; _gqcInterfaces: Array>; _gqcExtensions?: Extensions; _gqcDirectives?: Directive[]; _gqcIsModified?: boolean; static create(typeDef: ObjectTypeComposerDefinition, schemaComposer: SchemaComposer): ObjectTypeComposer; static createTemp(typeDef: ObjectTypeComposerDefinition, schemaComposer?: SchemaComposer): ObjectTypeComposer; constructor(graphqlType: GraphQLObjectType, schemaComposer: SchemaComposer); getFields(): ObjectTypeComposerFieldConfigMap; getFieldNames(): string[]; getField(fieldName: string): ObjectTypeComposerFieldConfig; hasField(fieldName: string): boolean; setFields(fields: ObjectTypeComposerFieldConfigMapDefinition): this; setField(fieldName: string, fieldConfig: ObjectTypeComposerFieldConfigDefinition): this; addFields(newFields: ObjectTypeComposerFieldConfigMapDefinition): this; addNestedFields(newFields: ObjectTypeComposerFieldConfigMapDefinition): this; removeField(fieldNameOrArray: string | string[]): this; removeOtherFields(fieldNameOrArray: string | string[]): this; reorderFields(names: string[]): this; extendField(fieldName: string, partialFieldConfig: Partial>): this; getFieldConfig(fieldName: string): GraphQLFieldConfig; getFieldType(fieldName: string): GraphQLOutputType; getFieldTypeName(fieldName: string): string; getFieldTC(fieldName: string): ComposeNamedOutputType; getFieldOTC(fieldName: string): ObjectTypeComposer; isFieldNonNull(fieldName: string): boolean; makeFieldNonNull(fieldNameOrArray: string | string[]): this; makeFieldNullable(fieldNameOrArray: string | string[]): this; isFieldPlural(fieldName: string): boolean; makeFieldPlural(fieldNameOrArray: string | string[]): this; makeFieldNonPlural(fieldNameOrArray: string | string[]): this; deprecateFields(fields: { [fieldName: string]: string; } | string[] | string): this; getFieldArgs(fieldName: string): ObjectTypeComposerArgumentConfigMap; getFieldArgNames(fieldName: string): string[]; hasFieldArg(fieldName: string, argName: string): boolean; getFieldArg(fieldName: string, argName: string): ObjectTypeComposerArgumentConfig; getFieldArgType(fieldName: string, argName: string): GraphQLInputType; getFieldArgTypeName(fieldName: string, argName: string): string; getFieldArgTC(fieldName: string, argName: string): ComposeNamedInputType; getFieldArgITC(fieldName: string, argName: string): InputTypeComposer; setFieldArgs(fieldName: string, args: ObjectTypeComposerArgumentConfigMapDefinition): this; addFieldArgs(fieldName: string, newArgs: ObjectTypeComposerArgumentConfigMapDefinition): this; setFieldArg(fieldName: string, argName: string, argConfig: ObjectTypeComposerArgumentConfigDefinition): this; removeFieldArg(fieldName: string, argNameOrArray: string | string[]): this; removeFieldOtherArgs(fieldName: string, argNameOrArray: string | string[]): this; isFieldArgPlural(fieldName: string, argName: string): boolean; makeFieldArgPlural(fieldName: string, argNameOrArray: string | string[]): this; makeFieldArgNonPlural(fieldName: string, argNameOrArray: string | string[]): this; isFieldArgNonNull(fieldName: string, argName: string): boolean; makeFieldArgNonNull(fieldName: string, argNameOrArray: string | string[]): this; makeFieldArgNullable(fieldName: string, argNameOrArray: string | string[]): this; getType(): GraphQLObjectType; getTypePlural(): ListComposer>; getTypeNonNull(): NonNullComposer>; get List(): ListComposer>; get NonNull(): NonNullComposer>; getTypeName(): string; setTypeName(name: string): this; getDescription(): string; setDescription(description: string): this; clone(newTypeNameOrTC: string | ObjectTypeComposer): ObjectTypeComposer; cloneTo(anotherSchemaComposer: SchemaComposer, cloneMap?: Map): ObjectTypeComposer; getIsTypeOf(): GraphQLIsTypeOfFn | undefined | null; setIsTypeOf(fn: GraphQLIsTypeOfFn | null | undefined): this; merge(type: GraphQLObjectType | GraphQLInterfaceType | ObjectTypeComposer | InterfaceTypeComposer): this; getInputType(): GraphQLInputObjectType; hasInputTypeComposer(): boolean; setInputTypeComposer(itc: InputTypeComposer): this; getInputTypeComposer(opts?: ToInputTypeOpts): InputTypeComposer; getITC(opts?: ToInputTypeOpts): InputTypeComposer; removeInputTypeComposer(): this; getResolvers(): Map>; hasResolver(name: string): boolean; getResolver(name: string, middlewares?: Array>): Resolver; setResolver(name: string, resolver: Resolver): this; addResolver(opts: Resolver | ResolverDefinition): this; removeResolver(resolverName: string): this; wrapResolver(resolverName: string, cbResolver: ResolverWrapCb): this; wrapResolverAs(resolverName: string, fromResolverName: string, cbResolver: ResolverWrapCb): this; wrapResolverResolve(resolverName: string, cbNextRp: ResolverNextRpCb): this; getInterfaces(): Array>; getInterfacesTypes(): Array; setInterfaces(interfaces: ReadonlyArray>): this; hasInterface(iface: InterfaceTypeComposerDefinition): boolean; addInterface(iface: InterfaceTypeComposerDefinition | InterfaceTypeComposerThunked): this; addInterfaces(ifaces: ReadonlyArray | InterfaceTypeComposerThunked>): this; removeInterface(iface: InterfaceTypeComposerDefinition): this; getExtensions(): Extensions; setExtensions(extensions: Extensions | undefined): 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; getFieldExtensions(fieldName: string): Extensions; setFieldExtensions(fieldName: string, extensions: Extensions): this; extendFieldExtensions(fieldName: string, extensions: Extensions): this; clearFieldExtensions(fieldName: string): this; getFieldExtension(fieldName: string, extensionName: string): unknown; hasFieldExtension(fieldName: string, extensionName: string): boolean; setFieldExtension(fieldName: string, extensionName: string, value: unknown): this; removeFieldExtension(fieldName: string, extensionName: string): this; getFieldArgExtensions(fieldName: string, argName: string): Extensions; setFieldArgExtensions(fieldName: string, argName: string, extensions: Extensions): this; extendFieldArgExtensions(fieldName: string, argName: string, extensions: Extensions): this; clearFieldArgExtensions(fieldName: string, argName: string): this; getFieldArgExtension(fieldName: string, argName: string, extensionName: string): unknown; hasFieldArgExtension(fieldName: string, argName: string, extensionName: string): boolean; setFieldArgExtension(fieldName: string, argName: string, extensionName: string, value: unknown): this; removeFieldArgExtension(fieldName: string, argName: string, extensionName: string): this; getDirectives(): Array; setDirectives(directives: Array): this; getDirectiveNames(): string[]; getDirectiveByName(directiveName: string): DirectiveArgs | undefined; setDirectiveByName(directiveName: string, args?: DirectiveArgs): this; getDirectiveById(idx: number): DirectiveArgs | undefined; getFieldDirectives(fieldName: string): Array; setFieldDirectives(fieldName: string, directives: Array | undefined): this; getFieldDirectiveNames(fieldName: string): string[]; getFieldDirectiveByName(fieldName: string, directiveName: string): DirectiveArgs | undefined; setFieldDirectiveByName(fieldName: string, directiveName: string, args?: DirectiveArgs): this; getFieldDirectiveById(fieldName: string, idx: number): DirectiveArgs | undefined; getFieldArgDirectives(fieldName: string, argName: string): Array; setFieldArgDirectives(fieldName: string, argName: string, directives: Array): this; getFieldArgDirectiveNames(fieldName: string, argName: string): string[]; getFieldArgDirectiveByName(fieldName: string, argName: string, directiveName: string): DirectiveArgs | undefined; setFieldArgDirectiveByName(fieldName: string, argName: string, directiveName: string, args?: DirectiveArgs): this; getFieldArgDirectiveById(fieldName: string, argName: string, idx: number): DirectiveArgs | undefined; addRelation = any>(fieldName: string, opts: Readonly>): this; getRelations(): ObjectTypeComposerRelationMap; _relationWithResolverToFC(opts: ObjectTypeComposerRelationOptsWithResolver, fieldName?: string): ObjectTypeComposerFieldConfig; setRecordIdFn(fn: ObjectTypeComposerGetRecordIdFn): this; hasRecordIdFn(): boolean; getRecordIdFn(): ObjectTypeComposerGetRecordIdFn; getRecordId(source: TSource, args?: Record, context?: TContext): string | number; get(path: string | string[]): TypeInPath | void; getNestedTCs(opts?: { exclude?: string[]; }, passedTypes?: Set>): Set>; toSDL(opts?: SchemaPrinterOptions & { deep?: boolean; exclude?: string[]; }): string; } //# sourceMappingURL=ObjectTypeComposer.d.ts.map