import { SchemaBuilder as SchemaBuilderClass } from './builder'; import { FieldBuilder as InternalFieldBuilder } from './fieldUtils/builder'; import { InputFieldBuilder as InternalInputFieldBuilder } from './fieldUtils/input'; import { InterfaceFieldBuilder as InternalInterfaceFieldBuilder } from './fieldUtils/interface'; import { MutationFieldBuilder as InternalMutationFieldBuilder } from './fieldUtils/mutation'; import { ObjectFieldBuilder as InternalObjectFieldBuilder } from './fieldUtils/object'; import { QueryFieldBuilder as InternalQueryFieldBuilder } from './fieldUtils/query'; import { RootFieldBuilder as InternalRootFieldBuilder } from './fieldUtils/root'; import { SubscriptionFieldBuilder as InternalSubscriptionFieldBuilder } from './fieldUtils/subscription'; import { ArgumentRef as InternalArgumentRef } from './refs/arg'; import { BaseTypeRef as InternalBaseTypeRef } from './refs/base'; import { EnumRef as InternalEnumRef } from './refs/enum'; import { FieldRef as InternalFieldRef } from './refs/field'; import { InputFieldRef as InternalInputFieldRef } from './refs/input-field'; import { InputListRef as InternalInputListRef } from './refs/input-list'; import { ImplementableInputObjectRef as InternalImplementableInputObjectRef, InputObjectRef as InternalInputObjectRef, } from './refs/input-object'; import { ImplementableInterfaceRef as InternalImplementableInterfaceRef, InterfaceRef as InternalInterfaceRef, } from './refs/interface'; import { ListRef as InternalListRef } from './refs/list'; import { ImplementableObjectRef as InternalImplementableObjectRef, ObjectRef as InternalObjectRef, } from './refs/object'; import { ScalarRef as InternalScalarRef } from './refs/scalar'; import { UnionRef as InternalUnionRef } from './refs/union'; import './types/global'; import type { AddVersionedDefaultsToBuilderOptions, FieldKind, InputTypeParam, NormalizeSchemeBuilderOptions, PothosInputFieldConfig, PothosOutputFieldConfig, PothosTypeConfig, RootName, SchemaTypes, TypeParam, } from './types'; export * from './errors'; export * from './plugins'; export * from './types'; export * from './utils'; const SchemaBuilder = SchemaBuilderClass as unknown as { registerPlugin: typeof SchemaBuilderClass.registerPlugin; allowPluginReRegistration: boolean; new = {}>( options: Types extends { Defaults: 'v3' } ? AddVersionedDefaultsToBuilderOptions, 'v3'> : NormalizeSchemeBuilderOptions>, ): PothosSchemaTypes.SchemaBuilder>; }; export default SchemaBuilder; export const FieldBuilder = InternalFieldBuilder as new < Types extends SchemaTypes, ParentShape, Kind extends Exclude = Exclude, >( builder: PothosSchemaTypes.SchemaBuilder, kind: FieldKind, graphqlKind: PothosSchemaTypes.PothosKindToGraphQLType[FieldKind], ) => PothosSchemaTypes.FieldBuilder; export type RootFieldBuilder< Types extends SchemaTypes, ParentShape, Kind extends FieldKind = FieldKind, > = PothosSchemaTypes.RootFieldBuilder; export const RootFieldBuilder = InternalRootFieldBuilder as new < Types extends SchemaTypes, ParentShape, Kind extends FieldKind = FieldKind, >( builder: PothosSchemaTypes.SchemaBuilder, kind: FieldKind, graphqlKind: PothosSchemaTypes.PothosKindToGraphQLType[FieldKind], ) => PothosSchemaTypes.RootFieldBuilder; export type QueryFieldBuilder< Types extends SchemaTypes, ParentShape, > = PothosSchemaTypes.QueryFieldBuilder; export const QueryFieldBuilder = InternalQueryFieldBuilder as new < Types extends SchemaTypes, ParentShape, >( builder: PothosSchemaTypes.SchemaBuilder, ) => PothosSchemaTypes.QueryFieldBuilder; export type MutationFieldBuilder< Types extends SchemaTypes, ParentShape, > = PothosSchemaTypes.MutationFieldBuilder; export const MutationFieldBuilder = InternalMutationFieldBuilder as new < Types extends SchemaTypes, ParentShape, >( builder: PothosSchemaTypes.SchemaBuilder, ) => PothosSchemaTypes.MutationFieldBuilder; export type SubscriptionFieldBuilder< Types extends SchemaTypes, ParentShape, > = PothosSchemaTypes.SubscriptionFieldBuilder; export const SubscriptionFieldBuilder = InternalSubscriptionFieldBuilder as new < Types extends SchemaTypes, ParentShape, >( builder: PothosSchemaTypes.SchemaBuilder, ) => PothosSchemaTypes.SubscriptionFieldBuilder; export type ObjectFieldBuilder< Types extends SchemaTypes, ParentShape, > = PothosSchemaTypes.ObjectFieldBuilder; export const ObjectFieldBuilder = InternalObjectFieldBuilder as new < Types extends SchemaTypes, ParentShape, >( builder: PothosSchemaTypes.SchemaBuilder, ) => PothosSchemaTypes.ObjectFieldBuilder; export type InterfaceFieldBuilder< Types extends SchemaTypes, ParentShape, > = PothosSchemaTypes.InterfaceFieldBuilder; export const InterfaceFieldBuilder = InternalInterfaceFieldBuilder as new < Types extends SchemaTypes, ParentShape, >( builder: PothosSchemaTypes.SchemaBuilder, ) => PothosSchemaTypes.InterfaceFieldBuilder; export type InputFieldBuilder< Types extends SchemaTypes, Kind extends 'Arg' | 'InputObject' = 'Arg' | 'InputObject', > = PothosSchemaTypes.InputFieldBuilder; export const InputFieldBuilder = InternalInputFieldBuilder as new < Types extends SchemaTypes, Kind extends 'Arg' | 'InputObject' = 'Arg' | 'InputObject', >( builder: PothosSchemaTypes.SchemaBuilder, kind: Kind, ) => PothosSchemaTypes.InputFieldBuilder; export type BaseTypeRef = PothosSchemaTypes.BaseTypeRef; export const BaseTypeRef = InternalBaseTypeRef as new ( kind: 'Enum' | 'InputObject' | 'Interface' | 'Object' | 'Scalar' | 'Union', name: string, ) => PothosSchemaTypes.BaseTypeRef; export type EnumRef = PothosSchemaTypes.EnumRef; export const EnumRef = InternalEnumRef as new ( name: string, ) => PothosSchemaTypes.EnumRef; export type InputObjectRef = PothosSchemaTypes.InputObjectRef< Types, T >; export const InputObjectRef = InternalInputObjectRef as new ( name: string, ) => PothosSchemaTypes.InputObjectRef; export type ImplementableInputObjectRef< Types extends SchemaTypes, T extends object, > = PothosSchemaTypes.ImplementableInputObjectRef; export const ImplementableInputObjectRef = InternalImplementableInputObjectRef as new < Types extends SchemaTypes, T extends object, >( builder: PothosSchemaTypes.SchemaBuilder, name: string, ) => PothosSchemaTypes.ImplementableInputObjectRef; export type InputListRef = PothosSchemaTypes.InputListRef; export const InputListRef = InternalInputListRef as new ( listType: InputTypeParam, required: boolean, ) => PothosSchemaTypes.InputListRef; export type InterfaceRef = PothosSchemaTypes.InterfaceRef< Types, T, P >; export const InterfaceRef = InternalInterfaceRef as new ( name: string, ) => PothosSchemaTypes.InterfaceRef; export type ImplementableInterfaceRef< Types extends SchemaTypes, T, P = T, > = PothosSchemaTypes.ImplementableInterfaceRef; export const ImplementableInterfaceRef = InternalImplementableInterfaceRef as new < Types extends SchemaTypes, T, P = T, >( builder: PothosSchemaTypes.SchemaBuilder, name: string, ) => PothosSchemaTypes.ImplementableInterfaceRef; export type ObjectRef = PothosSchemaTypes.ObjectRef< Types, T, P >; export const ObjectRef = InternalObjectRef as new ( name: string, ) => PothosSchemaTypes.ObjectRef; export type ImplementableObjectRef< Types extends SchemaTypes, T, P = T, > = PothosSchemaTypes.ImplementableObjectRef; export const ImplementableObjectRef = InternalImplementableObjectRef as new < Types extends SchemaTypes, T, P = T, >( builder: PothosSchemaTypes.SchemaBuilder, name: string, ) => PothosSchemaTypes.ImplementableObjectRef; export type ScalarRef = PothosSchemaTypes.ScalarRef< Types, T, U, P >; export const ScalarRef = InternalScalarRef as new ( name: string, ) => PothosSchemaTypes.ScalarRef; export type UnionRef = PothosSchemaTypes.UnionRef; export const UnionRef = InternalUnionRef as new ( name: string, ) => PothosSchemaTypes.UnionRef; export type ListRef = PothosSchemaTypes.ListRef; export const ListRef = InternalListRef as new ( listType: TypeParam, nullable: boolean, ) => PothosSchemaTypes.ListRef; export type FieldRef< Types extends SchemaTypes, T = unknown, Kind extends FieldKind = FieldKind, > = PothosSchemaTypes.FieldRef; export const FieldRef = InternalFieldRef as new < Types extends SchemaTypes, T = unknown, Kind extends FieldKind = FieldKind, >( kind: Kind, initConfig: (name: string, typeConfig: PothosTypeConfig) => PothosOutputFieldConfig, ) => PothosSchemaTypes.FieldRef; export type InputFieldRef = PothosSchemaTypes.InputFieldRef; export const InputFieldRef = InternalInputFieldRef as new ( initConfig: (name: string, typeConfig: PothosTypeConfig) => PothosInputFieldConfig, ) => PothosSchemaTypes.InputFieldRef; export type ArgumentRef = PothosSchemaTypes.ArgumentRef; export const ArgumentRef = InternalArgumentRef as new ( initConfig: ( name: string, field: string, typeConfig: PothosTypeConfig, ) => PothosInputFieldConfig, ) => PothosSchemaTypes.ArgumentRef; export { BuildCache } from './build-cache'; export { BuiltinScalarRef } from './refs/builtin-scalar'; export { InputTypeRef } from './refs/input'; export { MutationRef } from './refs/mutation'; export { OutputTypeRef } from './refs/output'; export { QueryRef } from './refs/query'; export { SubscriptionRef } from './refs/subscription';