Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/pothos/packages/core/config-store.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-1677173079/packages/core/config-store.ts";

Constructors

new
default()

Type Parameters

Types extends SchemaTypes

Properties

private
addFieldFns: (() => void)[]
private
fieldRefCallbacks: Map<FieldRef | InputFieldRef, ((config: PothosFieldConfig<Types>) => void)[]>
private
fieldRefs: WeakMap<FieldRef | InputFieldRef, (
name: string,
parentField: string | undefined,
typeConfig: PothosTypeConfig,
) => PothosFieldConfig<Types>>
private
fieldRefsToConfigs: Map<FieldRef | InputFieldRef, PothosFieldConfig<Types>[]>
private
fields: Map<string, Map<string, PothosFieldConfig<Types>>>
private
pending: boolean
private
pendingFields: Map<FieldRef | InputFieldRef, InputType<Types> | OutputType<Types>>
private
pendingInterfaces: Map<string, (() => InterfaceParam<Types>[])[]>
private
pendingRefResolutions: Map<ConfigurableRef<Types>, ((config: PothosTypeConfig) => void)[]>
private
pendingUnionTypes: Map<string, (() => ObjectParam<Types>[])[]>
private
refsToName: Map<ConfigurableRef<Types>, string>
private
scalarsToRefs: Map<string, BuiltinScalarRef<unknown, unknown>>
typeConfigs: Map<string, PothosTypeConfig>

Methods

private
buildField(
typeRef: ConfigurableRef<Types>,
field: FieldRef | InputFieldRef,
fieldName: string,
)
private
buildFields(typeRef: ConfigurableRef<Types>, fields: FieldMap | InputFieldMap)
private
describeRef(ref: ConfigurableRef<Types>): string
addFieldRef(
ref: FieldRef | InputFieldRef,
typeParam: InputTypeParam<Types> | TypeParam<Types>,
args: InputFieldMap,
getConfig: (
name: string,
parentField: string | undefined,
typeConfig: PothosTypeConfig,
) => PothosFieldConfig<Types>
,
)
addFields(typeRef: ConfigurableRef<Types>, fields: FieldMap | InputFieldMap | (() => FieldMap | InputFieldMap))
addInterfaces(typeName: string, interfaces: InterfaceParam<Types>[] | (() => InterfaceParam<Types>[]))
addTypeConfig(config: PothosTypeConfig, ref?: ConfigurableRef<Types>)
addUnionTypes(typeName: string, unionTypes: ObjectParam<Types>[] | (() => ObjectParam<Types>[]))
associateRefWithName(ref: ConfigurableRef<Types>, name: string)
createFieldConfig<T extends GraphQLFieldKind>(
ref: FieldRef | InputFieldRef,
name: string,
typeConfig: PothosTypeConfig,
parentField?: string,
kind?: T,
): Extract<PothosFieldConfig<Types>, { graphqlKind: T; }>
getFields<T extends GraphQLFieldKind>(name: string, kind?: T): Map<string, Extract<PothosFieldConfig<Types>, { graphqlKind: T; }>>
getImplementers(ref: ConfigurableRef<Types> | string)
getInputTypeRef(ref: ConfigurableRef<Types> | string)
getOutputTypeRef(ref: ConfigurableRef<Types> | string)
getTypeConfig<T extends PothosTypeConfig["kind"]>(ref: ConfigurableRef<Types> | string, kind?: T)
hasConfig(typeParam: InputType<Types> | OutputType<Types>)
onFieldUse(ref: FieldRef | InputFieldRef, cb: (config: PothosFieldConfig<Types>) => void)
onTypeConfig(ref: ConfigurableRef<Types>, cb: (config: PothosTypeConfig) => void)