import type { FieldKind, FieldMap, FieldNullability, GenericFieldRef, InputFieldMap, InterfaceParam, MaybeAsyncSelection, NormalizeArgs, OutputType, PluginName, SchemaTypes, ShapeFromTypeParam, TypeParam } from '@pothos/core'; import type { PathSegment } from '@pothos/selection-mapper'; import type { BuildQueryResult, DBQueryConfig, TableRelationalConfig, TablesRelationalConfig } from 'drizzle-orm'; import type { GraphQLResolveInfo } from 'graphql'; import type { DrizzleObjectFieldBuilder } from './drizzle-field-builder.js'; import type { PothosDrizzlePlugin } from './index.js'; import type { DrizzleInterfaceRef, DrizzleRef } from './interface-ref.js'; import type { DrizzleNodeRef } from './node-ref.js'; import type { DrizzleObjectRef, drizzleTableKey } from './object-ref.js'; import type { DrizzleConnectionFieldOptions, DrizzleConnectionShape, DrizzleFieldOptions, DrizzleFieldWithInputOptions, DrizzleInterfaceOptions, DrizzleNodeOptions, DrizzleObjectFieldOptions, DrizzleObjectOptions, DrizzlePluginOptions, DrizzleTableNameBrand, ShapeFromConnection, ShapeFromIdColumns } from './types.js'; import type { DrizzleQueryFromInfoResult } from './utils/map-query.js'; import type { DrizzleRelationsHint } from './utils/refs.js'; type IsDefaultConfigOfNames = IsUnion extends true ? (() => T extends TableConfig ? 1 : 2) extends () => (T extends Default ? 1 : 2) ? true : false : false; type IsUnion = T extends unknown ? ([All] extends [T] ? false : true) : never; declare global { export namespace PothosSchemaTypes { interface Plugins { drizzle: PothosDrizzlePlugin; } interface SchemaBuilderOptions { drizzle: DrizzlePluginOptions; } interface UserSchemaTypes { DrizzleRelations: TablesRelationalConfig; } interface ExtendDefaultTypes> { DrizzleRelations: PartialTypes['DrizzleRelations'] & {}; } interface SchemaBuilder { drizzleObject: [], Table extends keyof Types['DrizzleRelations'], Selection extends DBQueryConfig<'one', Types['DrizzleRelations'], Types['DrizzleRelations'][Table]> | true, Shape = BuildQueryResult>(table: Table | DrizzleRelationsHint, options: DrizzleObjectOptions) => DrizzleObjectRef; drizzleInterface: [], Table extends keyof Types['DrizzleRelations'], Selection extends DBQueryConfig<'one', Types['DrizzleRelations'], Types['DrizzleRelations'][Table]> | true, Shape = BuildQueryResult>(table: Table | DrizzleRelationsHint, options: DrizzleInterfaceOptions) => DrizzleInterfaceRef; drizzleNode: 'relay' extends PluginName ? [], Table extends keyof Types['DrizzleRelations'], Selection extends DBQueryConfig<'one', Types['DrizzleRelations'], Types['DrizzleRelations'][Table]> | true, IDColumns, Shape = BuildQueryResult>(table: Table | DrizzleRelationsHint, options: DrizzleNodeOptions) => DrizzleNodeRef> : '@pothos/plugin-relay is required to use this method'; drizzleObjectField: | keyof Types['DrizzleRelations'], TableConfig extends TableRelationalConfig = Type extends DrizzleObjectRef ? Type[typeof drizzleTableKey] : Types['DrizzleRelations'][Type & keyof Types['DrizzleRelations']], Shape extends {} = IsDefaultConfigOfNames ? Type[typeof drizzleTableKey] : Types['DrizzleRelations'][Type & keyof Types['DrizzleRelations']]> extends true ? Type extends DrizzleObjectRef ? S & DrizzleTableNameBrand : BuildQueryResult & DrizzleTableNameBrand : Type extends DrizzleObjectRef ? S & DrizzleTableNameBrand : BuildQueryResult & DrizzleTableNameBrand>(type: Type | DrizzleRelationsHint, fieldName: string, field: (t: DrizzleObjectFieldBuilder) => GenericFieldRef) => void; drizzleInterfaceField: | keyof Types['DrizzleRelations'], TableConfig extends TableRelationalConfig = Type extends DrizzleInterfaceRef ? Type[typeof drizzleTableKey] : Types['DrizzleRelations'][Type & keyof Types['DrizzleRelations']], Shape extends {} = IsDefaultConfigOfNames ? Type[typeof drizzleTableKey] : Types['DrizzleRelations'][Type & keyof Types['DrizzleRelations']]> extends true ? Type extends DrizzleInterfaceRef ? S & DrizzleTableNameBrand : BuildQueryResult & DrizzleTableNameBrand : Type extends DrizzleInterfaceRef ? S & DrizzleTableNameBrand : BuildQueryResult & DrizzleTableNameBrand>(type: Type | DrizzleRelationsHint, fieldName: string, field: (t: DrizzleObjectFieldBuilder) => GenericFieldRef) => void; drizzleObjectFields: | keyof Types['DrizzleRelations'], TableConfig extends TableRelationalConfig = Type extends DrizzleObjectRef ? Type[typeof drizzleTableKey] : Types['DrizzleRelations'][Type & keyof Types['DrizzleRelations']], Shape extends {} = IsDefaultConfigOfNames ? Type[typeof drizzleTableKey] : Types['DrizzleRelations'][Type & keyof Types['DrizzleRelations']]> extends true ? Type extends DrizzleObjectRef ? S & DrizzleTableNameBrand : BuildQueryResult & DrizzleTableNameBrand : Type extends DrizzleObjectRef ? S & DrizzleTableNameBrand : BuildQueryResult & DrizzleTableNameBrand>(type: Type | DrizzleRelationsHint, fields: (t: DrizzleObjectFieldBuilder) => FieldMap) => void; drizzleInterfaceFields: | keyof Types['DrizzleRelations'], TableConfig extends TableRelationalConfig = Type extends DrizzleInterfaceRef ? Type[typeof drizzleTableKey] : Types['DrizzleRelations'][Type & keyof Types['DrizzleRelations']], Shape extends {} = IsDefaultConfigOfNames ? Type[typeof drizzleTableKey] : Types['DrizzleRelations'][Type & keyof Types['DrizzleRelations']]> extends true ? Type extends DrizzleInterfaceRef ? S & DrizzleTableNameBrand : BuildQueryResult & DrizzleTableNameBrand : Type extends DrizzleInterfaceRef ? S & DrizzleTableNameBrand : BuildQueryResult & DrizzleTableNameBrand>(type: Type | DrizzleRelationsHint, fields: (t: DrizzleObjectFieldBuilder) => FieldMap) => void; } interface PothosKindToGraphQLType { DrizzleObject: 'Object'; } interface FieldOptionsByKind, Nullable extends FieldNullability, Args extends InputFieldMap, ResolveShape, ResolveReturnShape> { DrizzleObject: DrizzleObjectFieldOptions; } interface RootFieldBuilder { drizzleQueryFromInfo: = {}>(type: Table | DrizzleRef | DrizzleRelationsHint, options: Selection & DBQueryConfig<'many', Types['DrizzleRelations'], Types['DrizzleRelations'][Table]> & Record | 'context' | 'info' | 'path' | 'paths'>, never> & { context: Types['Context']; info: GraphQLResolveInfo; path?: PathSegment[]; paths?: PathSegment[][]; }) => MaybeAsyncSelection() => T extends Selection ? 1 : 2) extends () => (T extends DBQueryConfig<'many', Types['DrizzleRelations'], Types['DrizzleRelations'][Table]> ? 1 : 2) ? {} : Selection, Table>>; drizzleField: | [DrizzleRef], Nullable extends FieldNullability, ResolveShape, ResolveReturnShape, Table extends keyof Types['DrizzleRelations'] = Param extends keyof Types['DrizzleRelations'] ? Param : Param extends [keyof Types['DrizzleRelations']] ? Param[0] : Param extends DrizzleRef ? T & keyof Types['DrizzleRelations'] : Param extends [DrizzleRef] ? T & keyof Types['DrizzleRelations'] : never, Type extends TypeParam = Param extends DrizzleRef | [DrizzleRef] ? Param : Param extends [unknown] ? [ ObjectRef | { $pothosQueryFor: Table | undefined; }> ] : ObjectRef | { $pothosQueryFor: Table | undefined; }>>(options: DrizzleFieldOptions) => FieldRef>; drizzleConnection: 'relay' extends PluginName ? | keyof Types['DrizzleRelations'], Nullable extends boolean, ResolveReturnShape, Args extends InputFieldMap = {}, Shape = Type extends DrizzleRef ? Type['$inferType'] : BuildQueryResult | { $pothosQueryFor: Type | undefined; }, const ConnectionInterfaces extends InterfaceParam[] = [], const EdgeInterfaces extends InterfaceParam[] = []>(options: DrizzleConnectionFieldOptions ? K : Type & keyof Types['DrizzleRelations']], ObjectRef, Nullable, Args, ResolveReturnShape, Kind>, ...args: NormalizeArgs<[ connectionOptions: ConnectionObjectOptions, false, false, DrizzleConnectionShape, ConnectionInterfaces> | ObjectRef>>, edgeOptions: ConnectionEdgeObjectOptions, false, DrizzleConnectionShape, EdgeInterfaces> | ObjectRef ], 0>) => FieldRef>> : '@pothos/plugin-relay is required to use this method'; drizzleFieldWithInput: 'withInput' extends PluginName ? | [DrizzleRef], Nullable extends FieldNullability, ResolveShape, ResolveReturnShape, ArgRequired extends boolean, Fields extends InputFieldMap = {}, Args extends InputFieldMap = {}, InputName extends string = 'input', Table extends keyof Types['DrizzleRelations'] = Param extends keyof Types['DrizzleRelations'] ? Param : Param extends [keyof Types['DrizzleRelations']] ? Param[0] : Param extends DrizzleRef ? T & keyof Types['DrizzleRelations'] : Param extends [DrizzleRef] ? T & keyof Types['DrizzleRelations'] : never, Type extends TypeParam = ObjectRef | { $pothosQueryFor: Table | undefined; }>>(options: DrizzleFieldWithInputOptions) => FieldRef> : '@pothos/plugin-with-input is required to use this method'; } interface ConnectionFieldOptions, Nullable extends boolean, EdgeNullability extends FieldNullability<[unknown]>, NodeNullability extends boolean, Args extends InputFieldMap, ResolveReturnShape> { } interface ConnectionObjectOptions, EdgeNullability extends FieldNullability<[unknown]>, NodeNullability extends boolean, Resolved, Interfaces extends InterfaceParam[] = []> { } interface ConnectionEdgeObjectOptions, NodeNullability extends boolean, Resolved, Interfaces extends InterfaceParam[] = []> { } interface DefaultConnectionArguments { first?: number | null | undefined; last?: number | null | undefined; before?: string | null | undefined; after?: string | null | undefined; } interface ConnectionShapeHelper { } interface ScopeAuthFieldAuthScopes { } interface ScopeAuthContextForAuth { } interface FieldWithInputBaseOptions { } } } export {}; //# sourceMappingURL=global-types.d.ts.map