Skip to main content
Module

x/pothos/packages/core/builder.ts>default

Pothos GraphQL is library for creating GraphQL schemas in typescript using a strongly typed code first approach
Go to Latest
class default
import { default } from "https://deno.land/x/pothos@release-1713397530/packages/core/builder.ts";

Properties

configStore: ConfigStore<Types>
defaultFieldNullability: boolean
defaultInputFieldRequiredness: boolean

Methods

addScalarType<Name extends ScalarName<Types>>(
name: Name,
...args: NormalizeArgs<[Omit<PothosSchemaTypes.ScalarTypeOptions<Types, InputShape<Types, Name>, OutputShape<Types, Name>>, "serialize"> & { serialize?: GraphQLScalarSerializer<OutputShape<Types, Name>>; }]>,
)
args<Shape extends InputFieldMap>(fields: (t: PothosSchemaTypes.InputFieldBuilder<Types, "Arg">) => Shape): Shape
enumType<Param extends EnumParam, Values extends EnumValues<Types>>(param: Param, options: EnumTypeOptions<Types, Param, Values>)
inputRef<T extends object, Normalize = true>(name: string): ImplementableInputObjectRef<Types, RecursivelyNormalizeNullableFields<T>, Normalize extends false ? T : RecursivelyNormalizeNullableFields<T>>
inputType<Param extends InputObjectRef<unknown> | string, Fields extends Param extends PothosSchemaTypes.InputObjectRef<unknown> ? InputFieldsFromShape<InputShape<Types, Param>> : Param extends keyof Types["Inputs"] ? InputFieldsFromShape<InputShape<Types, Param>> : InputFieldMap>(param: Param, options: PothosSchemaTypes.InputObjectTypeOptions<Types, Fields>): PothosSchemaTypes.InputObjectRef<InputShapeFromFields<Fields>>
interfaceField<Type extends InterfaceParam<Types>>(
ref: Type,
fieldName: string,
)
interfaceFields<Type extends InterfaceParam<Types>>(ref: Type, fields: InterfaceFieldsShape<Types, ParentShape<Types, Type>>)
interfaceType<Param extends InterfaceParam<Types>, Interfaces extends InterfaceParam<Types>[], ResolveType>(
param: Param,
options: InterfaceTypeOptions<Types, Param, ParentShape<Types, Param>, Interfaces, ResolveType>,
)
mutationField(name: string, field: MutationFieldThunk<Types>)
mutationType(...args: NormalizeArgs<[PothosSchemaTypes.MutationTypeOptions<Types>, MutationFieldsShape<Types>], 0>)
objectField<Type extends ObjectParam<Types>>(
ref: Type,
fieldName: string,
)
objectFields<Type extends ObjectParam<Types>>(ref: Type, fields: ObjectFieldsShape<Types, ParentShape<Types, Type>>)
objectRef<T>(name: string): ImplementableObjectRef<Types, T>
objectType<Interfaces extends InterfaceParam<Types>[], Param extends ObjectParam<Types>>(
param: Param,
options: ObjectTypeOptions<Types, Param, ParentShape<Types, Param>, Interfaces>,
)
queryField(name: string, field: QueryFieldThunk<Types>)
queryType(...args: NormalizeArgs<[PothosSchemaTypes.QueryTypeOptions<Types>, QueryFieldsShape<Types>], 0>)
scalarType<Name extends ScalarName<Types>>(name: Name, options: PothosSchemaTypes.ScalarTypeOptions<Types, InputShape<Types, Name>, ParentShape<Types, Name>>)
subscriptionType(...args: NormalizeArgs<[PothosSchemaTypes.SubscriptionTypeOptions<Types>, SubscriptionFieldsShape<Types>], 0>)
toSchema(...args: NormalizeArgs<[PothosSchemaTypes.BuildSchemaOptions<Types>]>)
unionType<Member extends ObjectParam<Types>, ResolveType>(name: string, options: PothosSchemaTypes.UnionTypeOptions<Types, Member, ResolveType>)

Static Properties

allowPluginReRegistration: boolean