import type { FieldKind, FieldMap, FieldNullability, InputFieldMap, InterfaceParam, NormalizeArgs, OutputType, PluginName, SchemaTypes, ShapeFromTypeParam, TypeParam } from '@pothos/core'; import type { GraphQLResolveInfo } from 'graphql'; import type { PothosPrismaPlugin } from './index.js'; import type { PrismaInterfaceRef, PrismaRef } from './interface-ref.js'; import type { PrismaNodeRef } from './node-ref.js'; import type { PrismaObjectRef, prismaModelKey } from './object-ref.js'; import type { PrismaObjectFieldBuilder as InternalPrismaObjectFieldBuilder } from './prisma-field-builder.js'; import { type PrismaClient, type PrismaConnectionFieldOptions, type PrismaConnectionShape, type PrismaFieldOptions, type PrismaFieldWithInputOptions, type PrismaInterfaceTypeOptions, type PrismaModelTypes, type PrismaNodeOptions, type PrismaObjectFieldOptions, type PrismaObjectTypeOptions, prismaModelName, type ShapeFromConnection, type ShapeFromSelection } from './types.js'; declare global { export namespace PothosSchemaTypes { interface Plugins { prisma: PothosPrismaPlugin; } interface SchemaBuilderOptions { prisma: { filterConnectionTotalCount?: boolean; client: (ctx: Types["Context"]) => PrismaClient; dmmf: { datamodel: unknown; }; exposeDescriptions?: boolean | { models?: boolean; fields?: boolean; }; onUnusedQuery?: "error" | "warn" | ((info: GraphQLResolveInfo) => void) | null; maxConnectionSize?: number; defaultConnectionSize?: number; skipDeferredFragments?: boolean; } | { filterConnectionTotalCount?: boolean; client: PrismaClient; dmmf: { datamodel: unknown; }; exposeDescriptions?: boolean | { models?: boolean; fields?: boolean; }; onUnusedQuery?: "error" | "warn" | ((info: GraphQLResolveInfo) => void) | null; maxConnectionSize?: number; defaultConnectionSize?: number; skipDeferredFragments?: boolean; }; } interface UserSchemaTypes { PrismaTypes: {}; } interface ExtendDefaultTypes> { PrismaTypes: PartialTypes["PrismaTypes"] & {}; } interface PothosKindToGraphQLType { PrismaObject: "Object"; } interface FieldOptionsByKind, Nullable extends FieldNullability, Args extends InputFieldMap, ResolveShape, ResolveReturnShape> { PrismaObject: PrismaObjectFieldOptions; } interface SchemaBuilder { prismaObject: [], Model extends PrismaModelTypes & Types["PrismaTypes"][Name], Include = unknown, Select = unknown>(name: Name, options: PrismaObjectTypeOptions>) => PrismaObjectRef>; prismaInterface: [], Model extends PrismaModelTypes & Types["PrismaTypes"][Name], Include = unknown, Select = unknown>(name: Name, options: PrismaInterfaceTypeOptions>) => PrismaInterfaceRef>; prismaObjectField: | keyof Types["PrismaTypes"], Model extends PrismaModelTypes = Type extends PrismaObjectRef ? M : PrismaModelTypes & Types["PrismaTypes"][Type & keyof Types["PrismaTypes"]], Shape extends {} = Type extends PrismaObjectRef ? S & { [prismaModelName]?: Model["Name"]; } : Model["Shape"] & { [prismaModelName]?: Type; }>(type: Type, fieldName: string, field: (t: PrismaObjectFieldBuilder) => FieldRef) => void; prismaInterfaceField: | keyof Types["PrismaTypes"], Model extends PrismaModelTypes = Type extends PrismaInterfaceRef ? M : PrismaModelTypes & Types["PrismaTypes"][Type & keyof Types["PrismaTypes"]], Shape extends {} = Type extends PrismaInterfaceRef ? S & { [prismaModelName]?: Model["Name"]; } : Model["Shape"] & { [prismaModelName]?: Type; }>(type: Type, fieldName: string, field: (t: PrismaObjectFieldBuilder) => FieldRef) => void; prismaObjectFields: | keyof Types["PrismaTypes"], Model extends PrismaModelTypes = Type extends PrismaObjectRef ? M : PrismaModelTypes & Types["PrismaTypes"][Type & keyof Types["PrismaTypes"]], Shape extends {} = Type extends PrismaObjectRef ? S & { [prismaModelName]?: Model["Name"]; } : Model["Shape"] & { [prismaModelName]?: Type; }>(type: Type, fields: (t: PrismaObjectFieldBuilder) => FieldMap) => void; prismaInterfaceFields: | keyof Types["PrismaTypes"], Model extends PrismaModelTypes = Type extends PrismaInterfaceRef ? M : PrismaModelTypes & Types["PrismaTypes"][Type & keyof Types["PrismaTypes"]], Shape extends {} = Type extends PrismaInterfaceRef ? S & { [prismaModelName]?: Model["Name"]; } : Model["Shape"] & { [prismaModelName]?: Type; }>(type: Type, fields: (t: PrismaObjectFieldBuilder) => FieldMap) => void; prismaNode: "relay" extends PluginName ? [] = [ ], Include = unknown, Select = unknown, UniqueField = unknown>(name: Name, options: PrismaNodeOptions, UniqueField>) => PrismaNodeRef> : "@pothos/plugin-relay is required to use this method"; } interface RootFieldBuilder { prismaField: | keyof Types["PrismaTypes"] | [ keyof Types["PrismaTypes"] ] | [ PrismaRef ], Nullable extends FieldNullability, ResolveShape, ResolveReturnShape, Type extends TypeParam extends [ unknown ] ? [ ObjectRef ] : ObjectRef, Model extends PrismaModelTypes = PrismaModelTypes & (TypeParam extends [ keyof Types["PrismaTypes"] ] ? Types["PrismaTypes"][TypeParam[0]] : TypeParam extends [ PrismaRef ] ? TypeParam[0][typeof prismaModelKey] : TypeParam extends PrismaRef ? TypeParam[typeof prismaModelKey] : TypeParam extends keyof Types["PrismaTypes"] ? Types["PrismaTypes"][TypeParam] : never)>(options: PrismaFieldOptions) => FieldRef>; prismaConnection: "relay" extends PluginName ? | keyof Types["PrismaTypes"], Nullable extends boolean, ResolveReturnShape, Args extends InputFieldMap = {}, Model extends PrismaModelTypes = Type extends PrismaRef ? T : PrismaModelTypes & Types["PrismaTypes"][Type & keyof Types["PrismaTypes"]], Shape = Type extends PrismaRef ? S : Model["Shape"], const ConnectionInterfaces extends InterfaceParam[] = [ ], const EdgeInterfaces extends InterfaceParam[] = [ ]>(options: PrismaConnectionFieldOptions, Nullable, Args, ResolveReturnShape, Kind>, ...args: NormalizeArgs<[ connectionOptions: ConnectionObjectOptions, false, false, PrismaConnectionShape, ConnectionInterfaces> | ObjectRef>>, edgeOptions: ConnectionEdgeObjectOptions, false, PrismaConnectionShape, EdgeInterfaces> | ObjectRef ], 0>) => FieldRef>> : "@pothos/plugin-relay is required to use this method"; prismaFieldWithInput: "withInput" extends PluginName ? | keyof Types["PrismaTypes"] | [ keyof Types["PrismaTypes"] ] | [ PrismaRef ], Type extends TypeParam extends [ unknown ] ? [ ObjectRef ] : ObjectRef, ResolveShape, ResolveReturnShape, ArgRequired extends boolean, Args extends InputFieldMap = {}, Nullable extends FieldNullability = Types["DefaultFieldNullability"], InputName extends string = "input", Model extends PrismaModelTypes = PrismaModelTypes & (TypeParam extends [ keyof Types["PrismaTypes"] ] ? Types["PrismaTypes"][TypeParam[0]] : TypeParam extends [ PrismaRef ] ? TypeParam[0][typeof prismaModelKey] : TypeParam extends PrismaRef ? TypeParam[typeof prismaModelKey] : TypeParam extends keyof Types["PrismaTypes"] ? Types["PrismaTypes"][TypeParam] : never)>(options: PrismaFieldWithInputOptions) => 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 PrismaObjectFieldBuilder extends InternalPrismaObjectFieldBuilder, RootFieldBuilder { } interface FieldWithInputBaseOptions { } } } //# sourceMappingURL=global-types.d.ts.map