@pothos/core
Advanced tools
Comparing version 3.22.3 to 3.22.4
# Change Log | ||
## 3.22.4 | ||
### Patch Changes | ||
- 3a82d645: Apply esm transform to esm d.ts definitions | ||
## 3.22.3 | ||
@@ -4,0 +10,0 @@ |
import { GraphQLInterfaceType, GraphQLNamedType } from 'graphql'; | ||
import type SchemaBuilder from './builder'; | ||
import { BasePlugin } from './plugins'; | ||
import { InputType, OutputType, PothosEnumTypeConfig, PothosInputFieldConfig, PothosInputObjectTypeConfig, PothosInterfaceTypeConfig, PothosMutationTypeConfig, PothosObjectTypeConfig, PothosQueryTypeConfig, PothosScalarTypeConfig, PothosSubscriptionTypeConfig, PothosTypeConfig, PothosUnionTypeConfig, SchemaTypes } from './types'; | ||
import type SchemaBuilder from './builder.js'; | ||
import { BasePlugin } from './plugins/index.js'; | ||
import { InputType, OutputType, PothosEnumTypeConfig, PothosInputFieldConfig, PothosInputObjectTypeConfig, PothosInterfaceTypeConfig, PothosMutationTypeConfig, PothosObjectTypeConfig, PothosQueryTypeConfig, PothosScalarTypeConfig, PothosSubscriptionTypeConfig, PothosTypeConfig, PothosUnionTypeConfig, SchemaTypes } from './types/index.js'; | ||
export default class BuildCache<Types extends SchemaTypes> { | ||
@@ -19,3 +19,3 @@ types: Map<string, GraphQLNamedType>; | ||
constructor(builder: SchemaBuilder<Types>, options: PothosSchemaTypes.BuildSchemaOptions<Types>); | ||
getTypeConfig<T extends PothosTypeConfig['kind']>(ref: InputType<Types> | OutputType<Types> | string, kind?: T): Extract<PothosEnumTypeConfig, { | ||
getTypeConfig<T extends PothosTypeConfig["kind"]>(ref: InputType<Types> | OutputType<Types> | string, kind?: T): Extract<PothosEnumTypeConfig, { | ||
kind: T; | ||
@@ -64,2 +64,2 @@ }> | Extract<PothosInputObjectTypeConfig, { | ||
} | ||
//# sourceMappingURL=build-cache.d.ts.map | ||
//# sourceMappingURL=build-cache.d.ts.map |
import { GraphQLScalarSerializer, GraphQLScalarType, GraphQLSchema } from 'graphql'; | ||
import ConfigStore from './config-store'; | ||
import EnumRef from './refs/enum'; | ||
import InputObjectRef, { ImplementableInputObjectRef } from './refs/input-object'; | ||
import InterfaceRef, { ImplementableInterfaceRef } from './refs/interface'; | ||
import ObjectRef, { ImplementableObjectRef } from './refs/object'; | ||
import ScalarRef from './refs/scalar'; | ||
import UnionRef from './refs/union'; | ||
import type { AbstractReturnShape, BaseEnum, EnumParam, EnumTypeOptions, EnumValues, InputFieldMap, InputFieldsFromShape, InputShape, InputShapeFromFields, InterfaceFieldsShape, InterfaceFieldThunk, InterfaceParam, InterfaceTypeOptions, MutationFieldsShape, MutationFieldThunk, NormalizeArgs, NormalizeSchemeBuilderOptions, ObjectFieldsShape, ObjectFieldThunk, ObjectParam, ObjectTypeOptions, OutputShape, ParentShape, PluginConstructorMap, QueryFieldsShape, QueryFieldThunk, ScalarName, SchemaTypes, ShapeFromEnumValues, SubscriptionFieldsShape, SubscriptionFieldThunk, ValuesFromEnum } from './types'; | ||
import ConfigStore from './config-store.js'; | ||
import EnumRef from './refs/enum.js'; | ||
import InputObjectRef, { ImplementableInputObjectRef } from './refs/input-object.js'; | ||
import InterfaceRef, { ImplementableInterfaceRef } from './refs/interface.js'; | ||
import ObjectRef, { ImplementableObjectRef } from './refs/object.js'; | ||
import ScalarRef from './refs/scalar.js'; | ||
import UnionRef from './refs/union.js'; | ||
import type { AbstractReturnShape, BaseEnum, EnumParam, EnumTypeOptions, EnumValues, InputFieldMap, InputFieldsFromShape, InputShape, InputShapeFromFields, InterfaceFieldsShape, InterfaceFieldThunk, InterfaceParam, InterfaceTypeOptions, MutationFieldsShape, MutationFieldThunk, NormalizeArgs, NormalizeSchemeBuilderOptions, ObjectFieldsShape, ObjectFieldThunk, ObjectParam, ObjectTypeOptions, OutputShape, ParentShape, PluginConstructorMap, QueryFieldsShape, QueryFieldThunk, ScalarName, SchemaTypes, ShapeFromEnumValues, SubscriptionFieldsShape, SubscriptionFieldThunk, ValuesFromEnum } from './types/index.js'; | ||
export default class SchemaBuilder<Types extends SchemaTypes> { | ||
@@ -40,3 +40,3 @@ static plugins: Partial<PluginConstructorMap<SchemaTypes>>; | ||
subscriptionField(name: string, field: SubscriptionFieldThunk<Types>): void; | ||
args<Shape extends InputFieldMap>(fields: (t: PothosSchemaTypes.InputFieldBuilder<Types, 'Arg'>) => Shape): Shape; | ||
args<Shape extends InputFieldMap>(fields: (t: PothosSchemaTypes.InputFieldBuilder<Types, "Arg">) => Shape): Shape; | ||
interfaceType<Param extends InterfaceParam<Types>, Interfaces extends InterfaceParam<Types>[], ResolveType>(param: Param, options: InterfaceTypeOptions<Types, Param, ParentShape<Types, Param>, Interfaces, ResolveType>, fields?: InterfaceFieldsShape<Types, ParentShape<Types, Param>>): InterfaceRef<AbstractReturnShape<Types, Param, ResolveType>, ParentShape<Types, Param>>; | ||
@@ -48,3 +48,3 @@ interfaceFields<Type extends InterfaceParam<Types>>(ref: Type, fields: InterfaceFieldsShape<Types, ParentShape<Types, Type>>): void; | ||
scalarType<Name extends ScalarName<Types>>(name: Name, options: PothosSchemaTypes.ScalarTypeOptions<Types, InputShape<Types, Name>, ParentShape<Types, Name>>): ScalarRef<InputShape<Types, Name>, ParentShape<Types, Name>, InputShape<Types, Name>>; | ||
addScalarType<Name extends ScalarName<Types>>(name: Name, scalar: GraphQLScalarType, options: Omit<PothosSchemaTypes.ScalarTypeOptions<Types, InputShape<Types, Name>, OutputShape<Types, Name>>, 'serialize'> & { | ||
addScalarType<Name extends ScalarName<Types>>(name: Name, scalar: GraphQLScalarType, options: Omit<PothosSchemaTypes.ScalarTypeOptions<Types, InputShape<Types, Name>, OutputShape<Types, Name>>, "serialize"> & { | ||
serialize?: GraphQLScalarSerializer<OutputShape<Types, Name>>; | ||
@@ -56,4 +56,6 @@ }): ScalarRef<InputShape<Types, Name>, ParentShape<Types, Name>, InputShape<Types, Name>>; | ||
interfaceRef<T>(name: string): ImplementableInterfaceRef<Types, T>; | ||
toSchema(...args: NormalizeArgs<[options?: PothosSchemaTypes.BuildSchemaOptions<Types>]>): GraphQLSchema; | ||
toSchema(...args: NormalizeArgs<[ | ||
options?: PothosSchemaTypes.BuildSchemaOptions<Types> | ||
]>): GraphQLSchema; | ||
} | ||
//# sourceMappingURL=builder.d.ts.map | ||
//# sourceMappingURL=builder.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import FieldRef from './refs/field'; | ||
import InputFieldRef from './refs/input-field'; | ||
import type { ConfigurableRef, FieldMap, GraphQLFieldKind, InputFieldMap, InputType, InputTypeParam, InterfaceParam, OutputType, PothosFieldConfig, PothosObjectTypeConfig, PothosTypeConfig, SchemaTypes, TypeParam } from './types'; | ||
import FieldRef from './refs/field.js'; | ||
import InputFieldRef from './refs/input-field.js'; | ||
import type { ConfigurableRef, FieldMap, GraphQLFieldKind, InputFieldMap, InputType, InputTypeParam, InterfaceParam, OutputType, PothosFieldConfig, PothosObjectTypeConfig, PothosTypeConfig, SchemaTypes, TypeParam } from './types/index.js'; | ||
export default class ConfigStore<Types extends SchemaTypes> { | ||
@@ -26,3 +26,3 @@ typeConfigs: Map<string, PothosTypeConfig>; | ||
addTypeConfig(config: PothosTypeConfig, ref?: ConfigurableRef<Types>): void; | ||
getTypeConfig<T extends PothosTypeConfig['kind']>(ref: ConfigurableRef<Types> | string, kind?: T): Extract<import("./types").PothosEnumTypeConfig, { | ||
getTypeConfig<T extends PothosTypeConfig["kind"]>(ref: ConfigurableRef<Types> | string, kind?: T): Extract<import("./types").PothosEnumTypeConfig, { | ||
kind: T; | ||
@@ -60,2 +60,2 @@ }> | Extract<import("./types").PothosInputObjectTypeConfig, { | ||
} | ||
//# sourceMappingURL=config-store.d.ts.map | ||
//# sourceMappingURL=config-store.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import FieldRef from '../refs/field'; | ||
import type { FieldKind, InputFieldMap, ShapeFromTypeParam } from '../types'; | ||
import { CompatibleTypes, FieldNullability, SchemaTypes, TypeParam } from '../types'; | ||
import FieldRef from '../refs/field.js'; | ||
import type { FieldKind, InputFieldMap, ShapeFromTypeParam } from '../types/index.js'; | ||
import { CompatibleTypes, FieldNullability, SchemaTypes, TypeParam } from '../types/index.js'; | ||
export default class BaseFieldUtil<Types extends SchemaTypes, ParentShape, Kind extends FieldKind> { | ||
@@ -11,4 +11,4 @@ typename: string; | ||
protected createField<Args extends InputFieldMap, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>>(options: PothosSchemaTypes.FieldOptions<Types, ParentShape, Type, Nullable, Args, any, {}>): FieldRef<ShapeFromTypeParam<Types, Type, Nullable>, Kind>; | ||
protected exposeField<Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Name extends CompatibleTypes<Types, ParentShape, Type, Nullable>>(name: Name, { extensions, ...options }: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, ParentShape, Type, Nullable, {}, {}>, 'resolve'>): FieldRef<ShapeFromTypeParam<Types, Type, Nullable>, Kind>; | ||
protected exposeField<Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Name extends CompatibleTypes<Types, ParentShape, Type, Nullable>>(name: Name, { extensions, ...options }: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, ParentShape, Type, Nullable, {}, {}>, "resolve">): FieldRef<ShapeFromTypeParam<Types, Type, Nullable>, Kind>; | ||
} | ||
//# sourceMappingURL=base.d.ts.map | ||
//# sourceMappingURL=base.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { CompatibleTypes, FieldKind, FieldNullability, FieldOptionsFromKind, NormalizeArgs, SchemaTypes, TypeParam } from '../types'; | ||
import RootFieldBuilder from './root'; | ||
import { CompatibleTypes, FieldKind, FieldNullability, FieldOptionsFromKind, NormalizeArgs, SchemaTypes, TypeParam } from '../types/index.js'; | ||
import RootFieldBuilder from './root.js'; | ||
export default class FieldBuilder<Types extends SchemaTypes, ParentShape, Kind extends FieldKind = FieldKind> extends RootFieldBuilder<Types, ParentShape, Kind> { | ||
@@ -9,4 +9,4 @@ /** | ||
*/ | ||
exposeBoolean<Name extends CompatibleTypes<Types, ParentShape, 'Boolean', Nullable>, ResolveReturnShape, Nullable extends FieldNullability<'Boolean'> = Types['DefaultFieldNullability']>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, 'Boolean', Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
exposeBoolean<Name extends CompatibleTypes<Types, ParentShape, "Boolean", Nullable>, ResolveReturnShape, Nullable extends FieldNullability<"Boolean"> = Types["DefaultFieldNullability"]>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, "Boolean", Nullable, {}, Kind, ParentShape, ResolveReturnShape>, "resolve" | "type"> | ||
]>): import("..").FieldRef<FieldNullability<"Boolean"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Nullable extends true ? ("Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never, Kind>; | ||
@@ -18,4 +18,4 @@ /** | ||
*/ | ||
exposeFloat<Name extends CompatibleTypes<Types, ParentShape, 'Float', Nullable>, ResolveReturnShape, Nullable extends FieldNullability<'Float'> = Types['DefaultFieldNullability']>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, 'Float', Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
exposeFloat<Name extends CompatibleTypes<Types, ParentShape, "Float", Nullable>, ResolveReturnShape, Nullable extends FieldNullability<"Float"> = Types["DefaultFieldNullability"]>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, "Float", Nullable, {}, Kind, ParentShape, ResolveReturnShape>, "resolve" | "type"> | ||
]>): import("..").FieldRef<FieldNullability<"Float"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("Float" extends infer T ? T extends "Float" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Float" extends infer T ? T extends "Float" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Nullable extends true ? ("Float" extends infer T ? T extends "Float" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Float" extends infer T ? T extends "Float" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never, Kind>; | ||
@@ -27,4 +27,4 @@ /** | ||
*/ | ||
exposeID<Name extends CompatibleTypes<Types, ParentShape, 'ID', Nullable>, ResolveReturnShape, Nullable extends FieldNullability<'ID'> = Types['DefaultFieldNullability']>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, 'ID', Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
exposeID<Name extends CompatibleTypes<Types, ParentShape, "ID", Nullable>, ResolveReturnShape, Nullable extends FieldNullability<"ID"> = Types["DefaultFieldNullability"]>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, "ID", Nullable, {}, Kind, ParentShape, ResolveReturnShape>, "resolve" | "type"> | ||
]>): import("..").FieldRef<FieldNullability<"ID"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("ID" extends infer T ? T extends "ID" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "ID" extends infer T ? T extends "ID" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Nullable extends true ? ("ID" extends infer T ? T extends "ID" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "ID" extends infer T ? T extends "ID" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never, Kind>; | ||
@@ -36,4 +36,4 @@ /** | ||
*/ | ||
exposeInt<Name extends CompatibleTypes<Types, ParentShape, 'Int', Nullable>, ResolveReturnShape, Nullable extends FieldNullability<'Int'> = Types['DefaultFieldNullability']>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, 'Int', Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'args' | 'resolve' | 'type'> | ||
exposeInt<Name extends CompatibleTypes<Types, ParentShape, "Int", Nullable>, ResolveReturnShape, Nullable extends FieldNullability<"Int"> = Types["DefaultFieldNullability"]>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, "Int", Nullable, {}, Kind, ParentShape, ResolveReturnShape>, "args" | "resolve" | "type"> | ||
]>): import("..").FieldRef<FieldNullability<"Int"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("Int" extends infer T ? T extends "Int" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Int" extends infer T ? T extends "Int" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Nullable extends true ? ("Int" extends infer T ? T extends "Int" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Int" extends infer T ? T extends "Int" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never, Kind>; | ||
@@ -45,4 +45,4 @@ /** | ||
*/ | ||
exposeString<Name extends CompatibleTypes<Types, ParentShape, 'String', Nullable>, ResolveReturnShape, Nullable extends FieldNullability<'String'> = Types['DefaultFieldNullability']>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, 'String', Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
exposeString<Name extends CompatibleTypes<Types, ParentShape, "String", Nullable>, ResolveReturnShape, Nullable extends FieldNullability<"String"> = Types["DefaultFieldNullability"]>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, "String", Nullable, {}, Kind, ParentShape, ResolveReturnShape>, "resolve" | "type"> | ||
]>): import("..").FieldRef<FieldNullability<"String"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("String" extends infer T ? T extends "String" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "String" extends infer T ? T extends "String" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Nullable extends true ? ("String" extends infer T ? T extends "String" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "String" extends infer T ? T extends "String" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never, Kind>; | ||
@@ -54,7 +54,13 @@ /** | ||
*/ | ||
exposeBooleanList<Name extends CompatibleTypes<Types, ParentShape, ['Boolean'], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<['Boolean']> = Types['DefaultFieldNullability']>(name: Name, ...args: NormalizeArgs<[ | ||
exposeBooleanList<Name extends CompatibleTypes<Types, ParentShape, [ | ||
"Boolean" | ||
], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<[ | ||
"Boolean" | ||
]> = Types["DefaultFieldNullability"]>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'Boolean' | ||
], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, ["Boolean"], Nullable>, Kind>; | ||
"Boolean" | ||
], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, "resolve" | "type"> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, [ | ||
"Boolean" | ||
], Nullable>, Kind>; | ||
/** | ||
@@ -65,7 +71,13 @@ * Create a Float list field from a number[] property on the parent object | ||
*/ | ||
exposeFloatList<Name extends CompatibleTypes<Types, ParentShape, ['Float'], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<['Float']> = Types['DefaultFieldNullability']>(name: Name, ...args: NormalizeArgs<[ | ||
exposeFloatList<Name extends CompatibleTypes<Types, ParentShape, [ | ||
"Float" | ||
], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<[ | ||
"Float" | ||
]> = Types["DefaultFieldNullability"]>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'Float' | ||
], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, ["Float"], Nullable>, Kind>; | ||
"Float" | ||
], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, "resolve" | "type"> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, [ | ||
"Float" | ||
], Nullable>, Kind>; | ||
/** | ||
@@ -76,7 +88,13 @@ * Create an ID list field from an id[] property on the parent object | ||
*/ | ||
exposeIDList<Name extends CompatibleTypes<Types, ParentShape, ['ID'], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<['ID']> = Types['DefaultFieldNullability']>(name: Name, ...args: NormalizeArgs<[ | ||
exposeIDList<Name extends CompatibleTypes<Types, ParentShape, [ | ||
"ID" | ||
], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<[ | ||
"ID" | ||
]> = Types["DefaultFieldNullability"]>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'ID' | ||
], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, ["ID"], Nullable>, Kind>; | ||
"ID" | ||
], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, "resolve" | "type"> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, [ | ||
"ID" | ||
], Nullable>, Kind>; | ||
/** | ||
@@ -87,7 +105,13 @@ * Create a Int list field from a number[] property on the parent object | ||
*/ | ||
exposeIntList<Name extends CompatibleTypes<Types, ParentShape, ['Int'], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<['Int']> = Types['DefaultFieldNullability']>(name: Name, ...args: NormalizeArgs<[ | ||
exposeIntList<Name extends CompatibleTypes<Types, ParentShape, [ | ||
"Int" | ||
], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<[ | ||
"Int" | ||
]> = Types["DefaultFieldNullability"]>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'Int' | ||
], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, ["Int"], Nullable>, Kind>; | ||
"Int" | ||
], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, "resolve" | "type"> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, [ | ||
"Int" | ||
], Nullable>, Kind>; | ||
/** | ||
@@ -98,7 +122,13 @@ * Create a String list field from a string[] property on the parent object | ||
*/ | ||
exposeStringList<Name extends CompatibleTypes<Types, ParentShape, ['String'], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<['String']> = Types['DefaultFieldNullability']>(name: Name, ...args: NormalizeArgs<[ | ||
exposeStringList<Name extends CompatibleTypes<Types, ParentShape, [ | ||
"String" | ||
], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<[ | ||
"String" | ||
]> = Types["DefaultFieldNullability"]>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'String' | ||
], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, ["String"], Nullable>, Kind>; | ||
"String" | ||
], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, "resolve" | "type"> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, [ | ||
"String" | ||
], Nullable>, Kind>; | ||
/** | ||
@@ -110,5 +140,5 @@ * Create a field that resolves to a property of the corresponding type on the parent object | ||
expose<Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, ResolveReturnShape, Name extends CompatibleTypes<Types, ParentShape, Type, Nullable>>(name: Name, ...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, Type, Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve'> | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, Type, Nullable, {}, Kind, ParentShape, ResolveReturnShape>, "resolve"> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, Type, Nullable>, Kind>; | ||
} | ||
//# sourceMappingURL=builder.d.ts.map | ||
//# sourceMappingURL=builder.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import InputFieldRef from '../refs/input-field'; | ||
import type { ArgBuilder, FieldRequiredness, InputShapeFromTypeParam, NormalizeArgs } from '../types'; | ||
import { InputType, SchemaTypes } from '../types'; | ||
import InputFieldRef from '../refs/input-field.js'; | ||
import type { ArgBuilder, FieldRequiredness, InputShapeFromTypeParam, NormalizeArgs } from '../types/index.js'; | ||
import { InputType, SchemaTypes } from '../types/index.js'; | ||
export default class InputFieldBuilder<Types extends SchemaTypes, Kind extends keyof PothosSchemaTypes.InputFieldOptionsByKind> { | ||
@@ -12,3 +12,5 @@ builder: PothosSchemaTypes.SchemaBuilder<Types>; | ||
*/ | ||
boolean: <Req extends FieldRequiredness<"Boolean">>(...args: NormalizeArgs<[options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "Boolean", Req>[Kind], "type">], 0>) => InputFieldRef<FieldRequiredness<"Boolean"> extends Req ? Types["DefaultInputFieldRequiredness"] extends false ? ("Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Req extends true ? "Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : ("Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined, Kind>; | ||
boolean: <Req extends FieldRequiredness<"Boolean">>(...args: NormalizeArgs<[ | ||
options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "Boolean", Req>[Kind], "type"> | ||
], 0>) => InputFieldRef<FieldRequiredness<"Boolean"> extends Req ? Types["DefaultInputFieldRequiredness"] extends false ? ("Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Req extends true ? "Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : ("Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined, Kind>; | ||
/** | ||
@@ -18,3 +20,5 @@ * Create a Float input field | ||
*/ | ||
float: <Req extends FieldRequiredness<"Float">>(...args: NormalizeArgs<[options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "Float", Req>[Kind], "type">], 0>) => InputFieldRef<FieldRequiredness<"Float"> extends Req ? Types["DefaultInputFieldRequiredness"] extends false ? ("Float" extends infer T ? T extends "Float" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Float" extends infer T ? T extends "Float" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Req extends true ? "Float" extends infer T ? T extends "Float" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : ("Float" extends infer T ? T extends "Float" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined, Kind>; | ||
float: <Req extends FieldRequiredness<"Float">>(...args: NormalizeArgs<[ | ||
options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "Float", Req>[Kind], "type"> | ||
], 0>) => InputFieldRef<FieldRequiredness<"Float"> extends Req ? Types["DefaultInputFieldRequiredness"] extends false ? ("Float" extends infer T ? T extends "Float" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Float" extends infer T ? T extends "Float" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Req extends true ? "Float" extends infer T ? T extends "Float" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : ("Float" extends infer T ? T extends "Float" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined, Kind>; | ||
/** | ||
@@ -24,3 +28,5 @@ * Create a ID input field | ||
*/ | ||
id: <Req extends FieldRequiredness<"ID">>(...args: NormalizeArgs<[options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "ID", Req>[Kind], "type">], 0>) => InputFieldRef<FieldRequiredness<"ID"> extends Req ? Types["DefaultInputFieldRequiredness"] extends false ? ("ID" extends infer T ? T extends "ID" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "ID" extends infer T ? T extends "ID" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Req extends true ? "ID" extends infer T ? T extends "ID" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : ("ID" extends infer T ? T extends "ID" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined, Kind>; | ||
id: <Req extends FieldRequiredness<"ID">>(...args: NormalizeArgs<[ | ||
options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "ID", Req>[Kind], "type"> | ||
], 0>) => InputFieldRef<FieldRequiredness<"ID"> extends Req ? Types["DefaultInputFieldRequiredness"] extends false ? ("ID" extends infer T ? T extends "ID" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "ID" extends infer T ? T extends "ID" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Req extends true ? "ID" extends infer T ? T extends "ID" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : ("ID" extends infer T ? T extends "ID" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined, Kind>; | ||
/** | ||
@@ -30,3 +36,5 @@ * Create a Int input field | ||
*/ | ||
int: <Req extends FieldRequiredness<"Int">>(...args: NormalizeArgs<[options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "Int", Req>[Kind], "type">], 0>) => InputFieldRef<FieldRequiredness<"Int"> extends Req ? Types["DefaultInputFieldRequiredness"] extends false ? ("Int" extends infer T ? T extends "Int" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Int" extends infer T ? T extends "Int" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Req extends true ? "Int" extends infer T ? T extends "Int" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : ("Int" extends infer T ? T extends "Int" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined, Kind>; | ||
int: <Req extends FieldRequiredness<"Int">>(...args: NormalizeArgs<[ | ||
options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "Int", Req>[Kind], "type"> | ||
], 0>) => InputFieldRef<FieldRequiredness<"Int"> extends Req ? Types["DefaultInputFieldRequiredness"] extends false ? ("Int" extends infer T ? T extends "Int" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Int" extends infer T ? T extends "Int" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Req extends true ? "Int" extends infer T ? T extends "Int" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : ("Int" extends infer T ? T extends "Int" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined, Kind>; | ||
/** | ||
@@ -36,3 +44,5 @@ * Create a String input field | ||
*/ | ||
string: <Req extends FieldRequiredness<"String">>(...args: NormalizeArgs<[options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "String", Req>[Kind], "type">], 0>) => InputFieldRef<FieldRequiredness<"String"> extends Req ? Types["DefaultInputFieldRequiredness"] extends false ? ("String" extends infer T ? T extends "String" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "String" extends infer T ? T extends "String" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Req extends true ? "String" extends infer T ? T extends "String" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : ("String" extends infer T ? T extends "String" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined, Kind>; | ||
string: <Req extends FieldRequiredness<"String">>(...args: NormalizeArgs<[ | ||
options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "String", Req>[Kind], "type"> | ||
], 0>) => InputFieldRef<FieldRequiredness<"String"> extends Req ? Types["DefaultInputFieldRequiredness"] extends false ? ("String" extends infer T ? T extends "String" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "String" extends infer T ? T extends "String" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Req extends true ? "String" extends infer T ? T extends "String" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : ("String" extends infer T ? T extends "String" ? T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined, Kind>; | ||
/** | ||
@@ -42,3 +52,11 @@ * Create a Boolean list input field | ||
*/ | ||
booleanList: <Req extends FieldRequiredness<["Boolean"]>>(...args: NormalizeArgs<[options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, ["Boolean"], Req>[Kind], "type">], 0>) => InputFieldRef<InputShapeFromTypeParam<Types, ["Boolean"], Req>, Kind>; | ||
booleanList: <Req extends FieldRequiredness<[ | ||
"Boolean" | ||
]>>(...args: NormalizeArgs<[ | ||
options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, [ | ||
"Boolean" | ||
], Req>[Kind], "type"> | ||
], 0>) => InputFieldRef<InputShapeFromTypeParam<Types, [ | ||
"Boolean" | ||
], Req>, Kind>; | ||
/** | ||
@@ -48,3 +66,11 @@ * Create a Float list input field | ||
*/ | ||
floatList: <Req extends FieldRequiredness<["Float"]>>(...args: NormalizeArgs<[options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, ["Float"], Req>[Kind], "type">], 0>) => InputFieldRef<InputShapeFromTypeParam<Types, ["Float"], Req>, Kind>; | ||
floatList: <Req extends FieldRequiredness<[ | ||
"Float" | ||
]>>(...args: NormalizeArgs<[ | ||
options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, [ | ||
"Float" | ||
], Req>[Kind], "type"> | ||
], 0>) => InputFieldRef<InputShapeFromTypeParam<Types, [ | ||
"Float" | ||
], Req>, Kind>; | ||
/** | ||
@@ -54,3 +80,11 @@ * Create a ID list input field | ||
*/ | ||
idList: <Req extends FieldRequiredness<["ID"]>>(...args: NormalizeArgs<[options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, ["ID"], Req>[Kind], "type">], 0>) => InputFieldRef<InputShapeFromTypeParam<Types, ["ID"], Req>, Kind>; | ||
idList: <Req extends FieldRequiredness<[ | ||
"ID" | ||
]>>(...args: NormalizeArgs<[ | ||
options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, [ | ||
"ID" | ||
], Req>[Kind], "type"> | ||
], 0>) => InputFieldRef<InputShapeFromTypeParam<Types, [ | ||
"ID" | ||
], Req>, Kind>; | ||
/** | ||
@@ -60,3 +94,11 @@ * Create a Int list input field | ||
*/ | ||
intList: <Req extends FieldRequiredness<["Int"]>>(...args: NormalizeArgs<[options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, ["Int"], Req>[Kind], "type">], 0>) => InputFieldRef<InputShapeFromTypeParam<Types, ["Int"], Req>, Kind>; | ||
intList: <Req extends FieldRequiredness<[ | ||
"Int" | ||
]>>(...args: NormalizeArgs<[ | ||
options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, [ | ||
"Int" | ||
], Req>[Kind], "type"> | ||
], 0>) => InputFieldRef<InputShapeFromTypeParam<Types, [ | ||
"Int" | ||
], Req>, Kind>; | ||
/** | ||
@@ -66,3 +108,11 @@ * Create a String list input field | ||
*/ | ||
stringList: <Req extends FieldRequiredness<["String"]>>(...args: NormalizeArgs<[options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, ["String"], Req>[Kind], "type">], 0>) => InputFieldRef<InputShapeFromTypeParam<Types, ["String"], Req>, Kind>; | ||
stringList: <Req extends FieldRequiredness<[ | ||
"String" | ||
]>>(...args: NormalizeArgs<[ | ||
options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, [ | ||
"String" | ||
], Req>[Kind], "type"> | ||
], 0>) => InputFieldRef<InputShapeFromTypeParam<Types, [ | ||
"String" | ||
], Req>, Kind>; | ||
constructor(builder: PothosSchemaTypes.SchemaBuilder<Types>, kind: Kind, typename: string); | ||
@@ -74,5 +124,7 @@ argBuilder(): ArgBuilder<Types>; | ||
*/ | ||
field<Type extends InputType<Types> | [InputType<Types>], Req extends FieldRequiredness<Type>>(options: PothosSchemaTypes.InputFieldOptionsByKind<Types, Type, Req>[Kind]): InputFieldRef<InputShapeFromTypeParam<Types, Type, Req>, Kind>; | ||
field<Type extends InputType<Types> | [ | ||
InputType<Types> | ||
], Req extends FieldRequiredness<Type>>(options: PothosSchemaTypes.InputFieldOptionsByKind<Types, Type, Req>[Kind]): InputFieldRef<InputShapeFromTypeParam<Types, Type, Req>, Kind>; | ||
private helper; | ||
} | ||
//# sourceMappingURL=input.d.ts.map | ||
//# sourceMappingURL=input.d.ts.map |
@@ -1,6 +0,6 @@ | ||
import { SchemaTypes } from '../types'; | ||
import FieldBuilder from './builder'; | ||
export default class InterfaceFieldBuilder<Types extends SchemaTypes, ParentShape> extends FieldBuilder<Types, ParentShape, 'Interface'> { | ||
import { SchemaTypes } from '../types/index.js'; | ||
import FieldBuilder from './builder.js'; | ||
export default class InterfaceFieldBuilder<Types extends SchemaTypes, ParentShape> extends FieldBuilder<Types, ParentShape, "Interface"> { | ||
constructor(name: string, builder: PothosSchemaTypes.SchemaBuilder<Types>); | ||
} | ||
//# sourceMappingURL=interface.d.ts.map | ||
//# sourceMappingURL=interface.d.ts.map |
@@ -1,6 +0,6 @@ | ||
import { SchemaTypes } from '../types'; | ||
import RootFieldBuilder from './root'; | ||
export default class MutationFieldBuilder<Types extends SchemaTypes, ParentShape> extends RootFieldBuilder<Types, ParentShape, 'Mutation'> { | ||
import { SchemaTypes } from '../types/index.js'; | ||
import RootFieldBuilder from './root.js'; | ||
export default class MutationFieldBuilder<Types extends SchemaTypes, ParentShape> extends RootFieldBuilder<Types, ParentShape, "Mutation"> { | ||
constructor(builder: PothosSchemaTypes.SchemaBuilder<Types>); | ||
} | ||
//# sourceMappingURL=mutation.d.ts.map | ||
//# sourceMappingURL=mutation.d.ts.map |
@@ -1,6 +0,6 @@ | ||
import { SchemaTypes } from '../types'; | ||
import FieldBuilder from './builder'; | ||
export default class ObjectFieldBuilder<Types extends SchemaTypes, ParentShape> extends FieldBuilder<Types, ParentShape, 'Object'> { | ||
import { SchemaTypes } from '../types/index.js'; | ||
import FieldBuilder from './builder.js'; | ||
export default class ObjectFieldBuilder<Types extends SchemaTypes, ParentShape> extends FieldBuilder<Types, ParentShape, "Object"> { | ||
constructor(name: string, builder: PothosSchemaTypes.SchemaBuilder<Types>); | ||
} | ||
//# sourceMappingURL=object.d.ts.map | ||
//# sourceMappingURL=object.d.ts.map |
@@ -1,6 +0,6 @@ | ||
import { SchemaTypes } from '../types'; | ||
import RootFieldBuilder from './root'; | ||
export default class QueryFieldBuilder<Types extends SchemaTypes, ParentShape> extends RootFieldBuilder<Types, ParentShape, 'Query'> { | ||
import { SchemaTypes } from '../types/index.js'; | ||
import RootFieldBuilder from './root.js'; | ||
export default class QueryFieldBuilder<Types extends SchemaTypes, ParentShape> extends RootFieldBuilder<Types, ParentShape, "Query"> { | ||
constructor(builder: PothosSchemaTypes.SchemaBuilder<Types>); | ||
} | ||
//# sourceMappingURL=query.d.ts.map | ||
//# sourceMappingURL=query.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import type { ArgBuilder, InputFieldMap, NormalizeArgs } from '../types'; | ||
import { FieldKind, FieldNullability, FieldOptionsFromKind, SchemaTypes, TypeParam } from '../types'; | ||
import BaseFieldUtil from './base'; | ||
import type { ArgBuilder, InputFieldMap, NormalizeArgs } from '../types/index.js'; | ||
import { FieldKind, FieldNullability, FieldOptionsFromKind, SchemaTypes, TypeParam } from '../types/index.js'; | ||
import BaseFieldUtil from './base.js'; | ||
export default class RootFieldBuilder<Types extends SchemaTypes, ParentShape, Kind extends FieldKind = FieldKind> extends BaseFieldUtil<Types, ParentShape, Kind> { | ||
@@ -10,4 +10,4 @@ arg: ArgBuilder<Types>; | ||
*/ | ||
boolean<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<'Boolean'> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, 'Boolean', Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
boolean<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<"Boolean"> = Types["DefaultFieldNullability"]>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, "Boolean", Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type"> | ||
]>): import("..").FieldRef<FieldNullability<"Boolean"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Nullable extends true ? ("Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never, Kind>; | ||
@@ -18,4 +18,4 @@ /** | ||
*/ | ||
float<Args extends InputFieldMap, Nullable extends FieldNullability<'Float'>, ResolveShape, ResolveReturnShape>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, 'Float', Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
float<Args extends InputFieldMap, Nullable extends FieldNullability<"Float">, ResolveShape, ResolveReturnShape>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, "Float", Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type"> | ||
]>): import("..").FieldRef<FieldNullability<"Float"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("Float" extends infer T ? T extends "Float" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Float" extends infer T ? T extends "Float" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Nullable extends true ? ("Float" extends infer T ? T extends "Float" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Float" extends infer T ? T extends "Float" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never, Kind>; | ||
@@ -26,4 +26,4 @@ /** | ||
*/ | ||
id<Args extends InputFieldMap, Nullable extends FieldNullability<'ID'>, ResolveShape, ResolveReturnShape>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, 'ID', Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
id<Args extends InputFieldMap, Nullable extends FieldNullability<"ID">, ResolveShape, ResolveReturnShape>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, "ID", Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type"> | ||
]>): import("..").FieldRef<FieldNullability<"ID"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("ID" extends infer T ? T extends "ID" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "ID" extends infer T ? T extends "ID" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Nullable extends true ? ("ID" extends infer T ? T extends "ID" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "ID" extends infer T ? T extends "ID" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never, Kind>; | ||
@@ -34,4 +34,4 @@ /** | ||
*/ | ||
int<Args extends InputFieldMap, Nullable extends FieldNullability<'Int'>, ResolveShape, ResolveReturnShape>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, 'Int', Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
int<Args extends InputFieldMap, Nullable extends FieldNullability<"Int">, ResolveShape, ResolveReturnShape>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, "Int", Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type"> | ||
]>): import("..").FieldRef<FieldNullability<"Int"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("Int" extends infer T ? T extends "Int" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Int" extends infer T ? T extends "Int" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Nullable extends true ? ("Int" extends infer T ? T extends "Int" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "Int" extends infer T ? T extends "Int" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never, Kind>; | ||
@@ -42,4 +42,4 @@ /** | ||
*/ | ||
string<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<'String'> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, 'String', Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
string<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<"String"> = Types["DefaultFieldNullability"]>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, "String", Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type"> | ||
]>): import("..").FieldRef<FieldNullability<"String"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("String" extends infer T ? T extends "String" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "String" extends infer T ? T extends "String" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never : Nullable extends true ? ("String" extends infer T ? T extends "String" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never) | null | undefined : "String" extends infer T ? T extends "String" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("../types").BaseEnum ? import("../types").ValuesFromEnum<T> : never : never : never, Kind>; | ||
@@ -50,7 +50,11 @@ /** | ||
*/ | ||
booleanList<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<['Boolean']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
booleanList<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<[ | ||
"Boolean" | ||
]> = Types["DefaultFieldNullability"]>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'Boolean' | ||
], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, ["Boolean"], Nullable>, Kind>; | ||
"Boolean" | ||
], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type"> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, [ | ||
"Boolean" | ||
], Nullable>, Kind>; | ||
/** | ||
@@ -60,7 +64,11 @@ * Create a Float list field | ||
*/ | ||
floatList<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<['Float']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
floatList<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<[ | ||
"Float" | ||
]> = Types["DefaultFieldNullability"]>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'Float' | ||
], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, ["Float"], Nullable>, Kind>; | ||
"Float" | ||
], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type"> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, [ | ||
"Float" | ||
], Nullable>, Kind>; | ||
/** | ||
@@ -70,7 +78,11 @@ * Create a ID list field | ||
*/ | ||
idList<Args extends InputFieldMap, Nullable extends FieldNullability<['ID']>, ResolveShape, ResolveReturnShape>(...args: NormalizeArgs<[ | ||
idList<Args extends InputFieldMap, Nullable extends FieldNullability<[ | ||
"ID" | ||
]>, ResolveShape, ResolveReturnShape>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'ID' | ||
], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, ["ID"], Nullable>, Kind>; | ||
"ID" | ||
], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type"> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, [ | ||
"ID" | ||
], Nullable>, Kind>; | ||
/** | ||
@@ -80,7 +92,11 @@ * Create a Int list field | ||
*/ | ||
intList<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<['Int']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
intList<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<[ | ||
"Int" | ||
]> = Types["DefaultFieldNullability"]>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'Int' | ||
], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, ["Int"], Nullable>, Kind>; | ||
"Int" | ||
], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type"> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, [ | ||
"Int" | ||
], Nullable>, Kind>; | ||
/** | ||
@@ -90,7 +106,11 @@ * Create a String list field | ||
*/ | ||
stringList<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<['String']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
stringList<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<[ | ||
"String" | ||
]> = Types["DefaultFieldNullability"]>(...args: NormalizeArgs<[ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'String' | ||
], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, ["String"], Nullable>, Kind>; | ||
"String" | ||
], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type"> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, [ | ||
"String" | ||
], Nullable>, Kind>; | ||
/** | ||
@@ -100,4 +120,4 @@ * create a new field for the current type | ||
*/ | ||
field<Args extends InputFieldMap, Type extends TypeParam<Types>, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<Type> = Types['DefaultFieldNullability']>(options: FieldOptionsFromKind<Types, ParentShape, Type, Nullable, Args, Kind, ResolveShape, ResolveReturnShape>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, Type, Nullable>, Kind>; | ||
field<Args extends InputFieldMap, Type extends TypeParam<Types>, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<Type> = Types["DefaultFieldNullability"]>(options: FieldOptionsFromKind<Types, ParentShape, Type, Nullable, Args, Kind, ResolveShape, ResolveReturnShape>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, Type, Nullable>, Kind>; | ||
} | ||
//# sourceMappingURL=root.d.ts.map | ||
//# sourceMappingURL=root.d.ts.map |
@@ -1,6 +0,6 @@ | ||
import { SchemaTypes } from '../types'; | ||
import RootFieldBuilder from './root'; | ||
export default class SubscriptionFieldBuilder<Types extends SchemaTypes, ParentShape> extends RootFieldBuilder<Types, ParentShape, 'Subscription'> { | ||
import { SchemaTypes } from '../types/index.js'; | ||
import RootFieldBuilder from './root.js'; | ||
export default class SubscriptionFieldBuilder<Types extends SchemaTypes, ParentShape> extends RootFieldBuilder<Types, ParentShape, "Subscription"> { | ||
constructor(builder: PothosSchemaTypes.SchemaBuilder<Types>); | ||
} | ||
//# sourceMappingURL=subscription.d.ts.map | ||
//# sourceMappingURL=subscription.d.ts.map |
@@ -1,7 +0,7 @@ | ||
import './types/global'; | ||
import SchemaBuilderClass from './builder'; | ||
import type { FieldKind, NormalizeSchemeBuilderOptions, SchemaTypes } from './types'; | ||
export * from './plugins'; | ||
export * from './types'; | ||
export * from './utils'; | ||
import './types/global/index.js'; | ||
import SchemaBuilderClass from './builder.js'; | ||
import type { FieldKind, NormalizeSchemeBuilderOptions, SchemaTypes } from './types/index.js'; | ||
export * from './plugins/index.js'; | ||
export * from './types/index.js'; | ||
export * from './utils/index.js'; | ||
declare const SchemaBuilder: { | ||
@@ -26,6 +26,6 @@ new <Types extends Partial<PothosSchemaTypes.UserSchemaTypes> = {}>(options: import("./types").RemoveNeverKeys<PothosSchemaTypes.SchemaBuilderOptions<PothosSchemaTypes.ExtendDefaultTypes<Types>>>): PothosSchemaTypes.SchemaBuilder<PothosSchemaTypes.ExtendDefaultTypes<Types>>; | ||
export declare const InterfaceFieldBuilder: new <Types extends SchemaTypes, ParentShape>(name: string, builder: SchemaBuilderClass<Types>) => PothosSchemaTypes.InterfaceFieldBuilder<Types, ParentShape>; | ||
export declare type InputFieldBuilder<Types extends SchemaTypes, Kind extends 'Arg' | 'InputObject' = 'Arg' | 'InputObject'> = PothosSchemaTypes.InputFieldBuilder<Types, Kind>; | ||
export declare type InputFieldBuilder<Types extends SchemaTypes, Kind extends "Arg" | "InputObject" = "Arg" | "InputObject"> = PothosSchemaTypes.InputFieldBuilder<Types, Kind>; | ||
export declare const InputFieldBuilder: new <Types extends SchemaTypes, Kind extends "InputObject" | "Arg" = "InputObject" | "Arg">(builder: SchemaBuilderClass<Types>, kind: Kind, typename: string) => PothosSchemaTypes.InputFieldBuilder<Types, Kind>; | ||
export declare type BaseTypeRef = PothosSchemaTypes.BaseTypeRef; | ||
export declare const BaseTypeRef: new (kind: 'Enum' | 'InputObject' | 'Interface' | 'Object' | 'Scalar' | 'Union', name: string) => PothosSchemaTypes.BaseTypeRef; | ||
export declare const BaseTypeRef: new (kind: "Enum" | "InputObject" | "Interface" | "Object" | "Scalar" | "Union", name: string) => PothosSchemaTypes.BaseTypeRef; | ||
export declare type EnumRef<T, P = T> = PothosSchemaTypes.EnumRef<T, P>; | ||
@@ -43,11 +43,11 @@ export declare const EnumRef: new <T, P = T>(name: string) => PothosSchemaTypes.EnumRef<T, P>; | ||
export declare const UnionRef: new <T, P = T>(name: string) => PothosSchemaTypes.UnionRef<T, P>; | ||
export { default as BuildCache } from './build-cache'; | ||
export { default as BuiltinScalarRef } from './refs/builtin-scalar'; | ||
export { default as FieldRef } from './refs/field'; | ||
export { default as InputTypeRef } from './refs/input'; | ||
export { default as InputFieldRef } from './refs/input-field'; | ||
export { ImplementableInputObjectRef } from './refs/input-object'; | ||
export { ImplementableInterfaceRef } from './refs/interface'; | ||
export { ImplementableObjectRef } from './refs/object'; | ||
export { default as OutputTypeRef } from './refs/output'; | ||
//# sourceMappingURL=index.d.ts.map | ||
export { default as BuildCache } from './build-cache.js'; | ||
export { default as BuiltinScalarRef } from './refs/builtin-scalar.js'; | ||
export { default as FieldRef } from './refs/field.js'; | ||
export { default as InputTypeRef } from './refs/input.js'; | ||
export { default as InputFieldRef } from './refs/input-field.js'; | ||
export { ImplementableInputObjectRef } from './refs/input-object.js'; | ||
export { ImplementableInterfaceRef } from './refs/interface.js'; | ||
export { ImplementableObjectRef } from './refs/object.js'; | ||
export { default as OutputTypeRef } from './refs/output.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,3 +0,3 @@ | ||
export * from './merge-plugins'; | ||
export * from './plugin'; | ||
//# sourceMappingURL=index.d.ts.map | ||
export * from './merge-plugins.js'; | ||
export * from './plugin.js'; | ||
//# sourceMappingURL=index.d.ts.map |
import { GraphQLFieldResolver, GraphQLIsTypeOfFn, GraphQLSchema, GraphQLTypeResolver } from 'graphql'; | ||
import type BuildCache from '../build-cache'; | ||
import type { PothosEnumValueConfig, PothosInputFieldConfig, PothosInterfaceTypeConfig, PothosObjectTypeConfig, PothosOutputFieldConfig, PothosTypeConfig, PothosUnionTypeConfig, SchemaTypes } from '../types'; | ||
import { BasePlugin } from './plugin'; | ||
import type BuildCache from '../build-cache.js'; | ||
import type { PothosEnumValueConfig, PothosInputFieldConfig, PothosInterfaceTypeConfig, PothosObjectTypeConfig, PothosOutputFieldConfig, PothosTypeConfig, PothosUnionTypeConfig, SchemaTypes } from '../types/index.js'; | ||
import { BasePlugin } from './plugin.js'; | ||
export declare class MergedPlugins<Types extends SchemaTypes> extends BasePlugin<Types> { | ||
@@ -14,7 +14,7 @@ plugins: BasePlugin<Types, object>[]; | ||
afterBuild(schema: GraphQLSchema): GraphQLSchema; | ||
wrapResolve(resolve: GraphQLFieldResolver<unknown, Types['Context'], object>, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types["Context"], object, unknown>; | ||
wrapSubscribe(subscribe: GraphQLFieldResolver<unknown, Types['Context'], object> | undefined, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types["Context"], object, unknown> | undefined; | ||
wrapResolveType(resolveType: GraphQLTypeResolver<unknown, Types['Context']>, typeConfig: PothosInterfaceTypeConfig | PothosUnionTypeConfig): GraphQLTypeResolver<unknown, Types["Context"]>; | ||
wrapIsTypeOf(isTypeOf: GraphQLIsTypeOfFn<unknown, Types['Context']> | undefined, typeConfig: PothosObjectTypeConfig): GraphQLIsTypeOfFn<unknown, Types["Context"]> | undefined; | ||
wrapResolve(resolve: GraphQLFieldResolver<unknown, Types["Context"], object>, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types["Context"], object, unknown>; | ||
wrapSubscribe(subscribe: GraphQLFieldResolver<unknown, Types["Context"], object> | undefined, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types["Context"], object, unknown> | undefined; | ||
wrapResolveType(resolveType: GraphQLTypeResolver<unknown, Types["Context"]>, typeConfig: PothosInterfaceTypeConfig | PothosUnionTypeConfig): GraphQLTypeResolver<unknown, Types["Context"]>; | ||
wrapIsTypeOf(isTypeOf: GraphQLIsTypeOfFn<unknown, Types["Context"]> | undefined, typeConfig: PothosObjectTypeConfig): GraphQLIsTypeOfFn<unknown, Types["Context"]> | undefined; | ||
} | ||
//# sourceMappingURL=merge-plugins.d.ts.map | ||
//# sourceMappingURL=merge-plugins.d.ts.map |
import { GraphQLFieldResolver, GraphQLIsTypeOfFn, GraphQLSchema, GraphQLTypeResolver } from 'graphql'; | ||
import type BuildCache from '../build-cache'; | ||
import type { PothosEnumValueConfig, PothosInputFieldConfig, PothosInterfaceTypeConfig, PothosObjectTypeConfig, PothosOutputFieldConfig, PothosTypeConfig, PothosUnionTypeConfig, SchemaTypes } from '../types'; | ||
import type BuildCache from '../build-cache.js'; | ||
import type { PothosEnumValueConfig, PothosInputFieldConfig, PothosInterfaceTypeConfig, PothosObjectTypeConfig, PothosOutputFieldConfig, PothosTypeConfig, PothosUnionTypeConfig, SchemaTypes } from '../types/index.js'; | ||
export declare class BasePlugin<Types extends SchemaTypes, T extends object = object> { | ||
@@ -51,3 +51,3 @@ name: never; | ||
*/ | ||
wrapResolve(resolver: GraphQLFieldResolver<unknown, Types['Context'], object>, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types['Context'], object>; | ||
wrapResolve(resolver: GraphQLFieldResolver<unknown, Types["Context"], object>, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types["Context"], object>; | ||
/** | ||
@@ -59,3 +59,3 @@ * Called with the subscribe for each field on the Subscription type | ||
*/ | ||
wrapSubscribe(subscribe: GraphQLFieldResolver<unknown, Types['Context'], object> | undefined, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types['Context'], object> | undefined; | ||
wrapSubscribe(subscribe: GraphQLFieldResolver<unknown, Types["Context"], object> | undefined, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types["Context"], object> | undefined; | ||
/** | ||
@@ -67,3 +67,3 @@ * Called with the resolveType for each Interface or Union type | ||
*/ | ||
wrapResolveType(resolveType: GraphQLTypeResolver<unknown, Types['Context']>, typeConfig: PothosInterfaceTypeConfig | PothosUnionTypeConfig): GraphQLTypeResolver<unknown, Types['Context']>; | ||
wrapResolveType(resolveType: GraphQLTypeResolver<unknown, Types["Context"]>, typeConfig: PothosInterfaceTypeConfig | PothosUnionTypeConfig): GraphQLTypeResolver<unknown, Types["Context"]>; | ||
/** | ||
@@ -75,3 +75,3 @@ * Called with the isTypeOf for each Object type | ||
*/ | ||
wrapIsTypeOf(isTypeOf: GraphQLIsTypeOfFn<unknown, Types['Context']> | undefined, typeConfig: PothosObjectTypeConfig): GraphQLIsTypeOfFn<unknown, Types['Context']> | undefined; | ||
wrapIsTypeOf(isTypeOf: GraphQLIsTypeOfFn<unknown, Types["Context"]> | undefined, typeConfig: PothosObjectTypeConfig): GraphQLIsTypeOfFn<unknown, Types["Context"]> | undefined; | ||
protected runUnique<R>(key: unknown, cb: () => R): R; | ||
@@ -83,3 +83,3 @@ /** | ||
*/ | ||
protected createRequestData(context: Types['Context']): T; | ||
protected createRequestData(context: Types["Context"]): T; | ||
/** | ||
@@ -90,4 +90,4 @@ * Returns a data object for the current request. requires `createRequestData` to be implemented | ||
*/ | ||
protected requestData(context: Types['Context']): T; | ||
protected requestData(context: Types["Context"]): T; | ||
} | ||
//# sourceMappingURL=plugin.d.ts.map | ||
//# sourceMappingURL=plugin.d.ts.map |
export default class BaseTypeRef implements PothosSchemaTypes.BaseTypeRef { | ||
kind: "Enum" | "InputObject" | "Interface" | "Object" | "Scalar" | "Union"; | ||
name: string; | ||
constructor(kind: 'Enum' | 'InputObject' | 'Interface' | 'Object' | 'Scalar' | 'Union', name: string); | ||
constructor(kind: "Enum" | "InputObject" | "Interface" | "Object" | "Scalar" | "Union", name: string); | ||
toString(): string; | ||
} | ||
//# sourceMappingURL=base.d.ts.map | ||
//# sourceMappingURL=base.d.ts.map |
import { GraphQLScalarType } from 'graphql'; | ||
import ScalarRef from './scalar'; | ||
import ScalarRef from './scalar.js'; | ||
export default class BuiltinScalarRef<T, U> extends ScalarRef<T, U> { | ||
@@ -7,2 +7,2 @@ type: GraphQLScalarType<unknown, unknown>; | ||
} | ||
//# sourceMappingURL=builtin-scalar.d.ts.map | ||
//# sourceMappingURL=builtin-scalar.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { InputRef, inputShapeKey, OutputRef, outputShapeKey } from '../types'; | ||
import BaseTypeRef from './base'; | ||
import { InputRef, inputShapeKey, OutputRef, outputShapeKey } from '../types/index.js'; | ||
import BaseTypeRef from './base.js'; | ||
export default class EnumRef<T, U = T> extends BaseTypeRef implements OutputRef, InputRef, PothosSchemaTypes.EnumRef<T, U> { | ||
@@ -9,2 +9,2 @@ kind: "Enum"; | ||
} | ||
//# sourceMappingURL=enum.d.ts.map | ||
//# sourceMappingURL=enum.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { FieldKind, outputFieldShapeKey } from '../types'; | ||
import { FieldKind, outputFieldShapeKey } from '../types/index.js'; | ||
export default class FieldRef<T = unknown, Kind extends FieldKind = FieldKind> { | ||
@@ -10,2 +10,2 @@ kind: FieldKind; | ||
} | ||
//# sourceMappingURL=field.d.ts.map | ||
//# sourceMappingURL=field.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import { inputFieldShapeKey } from '../types'; | ||
import FieldRef from './field'; | ||
export default class InputFieldRef<T = unknown, Kind extends 'Arg' | 'InputObject' = 'Arg' | 'InputObject'> { | ||
import { inputFieldShapeKey } from '../types/index.js'; | ||
import FieldRef from './field.js'; | ||
export default class InputFieldRef<T = unknown, Kind extends "Arg" | "InputObject" = "Arg" | "InputObject"> { | ||
kind: Kind; | ||
@@ -12,2 +12,2 @@ parentTypename: string; | ||
} | ||
//# sourceMappingURL=input-field.d.ts.map | ||
//# sourceMappingURL=input-field.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { InputFieldsFromShape, InputRef, inputShapeKey, RecursivelyNormalizeNullableFields, SchemaTypes } from '../types'; | ||
import BaseTypeRef from './base'; | ||
import { InputFieldsFromShape, InputRef, inputShapeKey, RecursivelyNormalizeNullableFields, SchemaTypes } from '../types/index.js'; | ||
import BaseTypeRef from './base.js'; | ||
export default class InputObjectRef<T> extends BaseTypeRef implements InputRef<T>, PothosSchemaTypes.InputObjectRef<T> { | ||
@@ -13,2 +13,2 @@ kind: "InputObject"; | ||
} | ||
//# sourceMappingURL=input-object.d.ts.map | ||
//# sourceMappingURL=input-object.d.ts.map |
@@ -1,8 +0,8 @@ | ||
import { inputShapeKey } from '../types'; | ||
import BaseTypeRef from './base'; | ||
import { inputShapeKey } from '../types/index.js'; | ||
import BaseTypeRef from './base.js'; | ||
export default class InputTypeRef<T> extends BaseTypeRef { | ||
kind: "Enum" | "InputObject" | "Scalar"; | ||
[inputShapeKey]: T; | ||
constructor(kind: 'Enum' | 'InputObject' | 'Scalar', name: string); | ||
constructor(kind: "Enum" | "InputObject" | "Scalar", name: string); | ||
} | ||
//# sourceMappingURL=input.d.ts.map | ||
//# sourceMappingURL=input.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { InterfaceParam, InterfaceTypeOptions, OutputRef, outputShapeKey, parentShapeKey, SchemaTypes } from '../types'; | ||
import BaseTypeRef from './base'; | ||
import { InterfaceParam, InterfaceTypeOptions, OutputRef, outputShapeKey, parentShapeKey, SchemaTypes } from '../types/index.js'; | ||
import BaseTypeRef from './base.js'; | ||
export default class InterfaceRef<T, P = T> extends BaseTypeRef implements OutputRef, PothosSchemaTypes.InterfaceRef<T, P> { | ||
@@ -14,2 +14,2 @@ kind: "Interface"; | ||
} | ||
//# sourceMappingURL=interface.d.ts.map | ||
//# sourceMappingURL=interface.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { InterfaceParam, ObjectTypeOptions, OutputRef, outputShapeKey, parentShapeKey, SchemaTypes } from '../types'; | ||
import BaseTypeRef from './base'; | ||
import { InterfaceParam, ObjectTypeOptions, OutputRef, outputShapeKey, parentShapeKey, SchemaTypes } from '../types/index.js'; | ||
import BaseTypeRef from './base.js'; | ||
export default class ObjectRef<T, P = T> extends BaseTypeRef implements OutputRef, PothosSchemaTypes.ObjectRef<T, P> { | ||
@@ -12,4 +12,4 @@ kind: "Object"; | ||
constructor(builder: PothosSchemaTypes.SchemaBuilder<Types>, name: string); | ||
implement<Interfaces extends InterfaceParam<Types>[]>(options: Omit<ObjectTypeOptions<Types, ImplementableObjectRef<Types, Shape, Parent>, Parent, Interfaces>, 'name'>): PothosSchemaTypes.ObjectRef<Shape, Parent>; | ||
implement<Interfaces extends InterfaceParam<Types>[]>(options: Omit<ObjectTypeOptions<Types, ImplementableObjectRef<Types, Shape, Parent>, Parent, Interfaces>, "name">): PothosSchemaTypes.ObjectRef<Shape, Parent>; | ||
} | ||
//# sourceMappingURL=object.d.ts.map | ||
//# sourceMappingURL=object.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { outputShapeKey, parentShapeKey } from '../types'; | ||
import BaseTypeRef from './base'; | ||
import { outputShapeKey, parentShapeKey } from '../types/index.js'; | ||
import BaseTypeRef from './base.js'; | ||
export default class OutputTypeRef<T, P = T> extends BaseTypeRef { | ||
@@ -7,4 +7,4 @@ kind: "Enum" | "Interface" | "Object" | "Scalar" | "Union"; | ||
[parentShapeKey]: P; | ||
constructor(kind: 'Enum' | 'Interface' | 'Object' | 'Scalar' | 'Union', name: string); | ||
constructor(kind: "Enum" | "Interface" | "Object" | "Scalar" | "Union", name: string); | ||
} | ||
//# sourceMappingURL=output.d.ts.map | ||
//# sourceMappingURL=output.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { InputRef, inputShapeKey, OutputRef, outputShapeKey, parentShapeKey } from '../types'; | ||
import BaseTypeRef from './base'; | ||
import { InputRef, inputShapeKey, OutputRef, outputShapeKey, parentShapeKey } from '../types/index.js'; | ||
import BaseTypeRef from './base.js'; | ||
export default class ScalarRef<T, U, P = T> extends BaseTypeRef implements OutputRef, InputRef, PothosSchemaTypes.ScalarRef<T, U, P> { | ||
@@ -10,2 +10,2 @@ kind: "Scalar"; | ||
} | ||
//# sourceMappingURL=scalar.d.ts.map | ||
//# sourceMappingURL=scalar.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { OutputRef, outputShapeKey, parentShapeKey } from '../types/type-params'; | ||
import BaseTypeRef from './base'; | ||
import { OutputRef, outputShapeKey, parentShapeKey } from '../types/type-params.js'; | ||
import BaseTypeRef from './base.js'; | ||
export default class UnionRef<T, P = T> extends BaseTypeRef implements OutputRef, PothosSchemaTypes.UnionRef<T, P> { | ||
@@ -9,2 +9,2 @@ kind: "Union"; | ||
} | ||
//# sourceMappingURL=union.d.ts.map | ||
//# sourceMappingURL=union.d.ts.map |
import type { GraphQLResolveInfo } from 'graphql'; | ||
import type FieldRef from '../refs/field'; | ||
import type InputFieldRef from '../refs/input-field'; | ||
import type InterfaceRef from '../refs/interface'; | ||
import type ObjectRef from '../refs/object'; | ||
import type { SchemaTypes } from './schema-types'; | ||
import type { BaseEnum, EnumParam, FieldNullability, inputFieldShapeKey, InputRef, InterfaceParam, ObjectParam, ParentShape as GetParentShape, ShapeFromTypeParam, TypeParam } from './type-params'; | ||
import type { MaybePromise, Merge, Normalize, NormalizeNullableFields, RemoveNeverKeys } from './utils'; | ||
import type FieldRef from '../refs/field.js'; | ||
import type InputFieldRef from '../refs/input-field.js'; | ||
import type InterfaceRef from '../refs/interface.js'; | ||
import type ObjectRef from '../refs/object.js'; | ||
import type { SchemaTypes } from './schema-types.js'; | ||
import type { BaseEnum, EnumParam, FieldNullability, inputFieldShapeKey, InputRef, InterfaceParam, ObjectParam, ParentShape as GetParentShape, ShapeFromTypeParam, TypeParam } from './type-params.js'; | ||
import type { MaybePromise, Merge, Normalize, NormalizeNullableFields, RemoveNeverKeys } from './utils.js'; | ||
export declare type NormalizeSchemeBuilderOptions<Types extends SchemaTypes> = RemoveNeverKeys<PothosSchemaTypes.SchemaBuilderOptions<Types>>; | ||
export declare type Resolver<Parent, Args, Context, Type, Return = unknown> = (parent: Parent, args: Args, context: Context, info: GraphQLResolveInfo) => [Type] extends [readonly (infer Item)[] | null | undefined] ? ListResolveValue<Type, Item, Return> : MaybePromise<Type>; | ||
export declare type Resolver<Parent, Args, Context, Type, Return = unknown> = (parent: Parent, args: Args, context: Context, info: GraphQLResolveInfo) => [ | ||
Type | ||
] extends [ | ||
readonly (infer Item)[] | null | undefined | ||
] ? ListResolveValue<Type, Item, Return> : MaybePromise<Type>; | ||
export declare type ListResolveValue<Type, Item, Return> = Return extends AsyncGenerator<unknown, unknown> ? GeneratorResolver<Type, Item> & Return : null extends Type ? Return extends MaybePromise<readonly MaybePromise<Item>[] | null | undefined> ? Return : MaybePromise<readonly MaybePromise<Item>[]> | null | undefined : Return extends MaybePromise<readonly MaybePromise<Item>[]> ? Return : MaybePromise<readonly MaybePromise<Item>[]>; | ||
@@ -17,16 +21,16 @@ export declare type GeneratorResolver<Type, Item> = null extends Type ? AsyncGenerator<Item | null | undefined, Item | null | undefined> : AsyncGenerator<Item, Item>; | ||
export declare type ShapeFromEnumValues<Types extends SchemaTypes, Values extends EnumValues<Types>> = Values extends readonly string[] ? Values[number] : Values extends EnumValueConfigMap<Types> ? { | ||
[K in keyof Values]: Values[K]['value'] extends number | string ? Values[K]['value'] : K; | ||
[K in keyof Values]: Values[K]["value"] extends number | string ? Values[K]["value"] : K; | ||
}[keyof Values] : never; | ||
export declare type ObjectFieldsShape<Types extends SchemaTypes, Shape> = (t: PothosSchemaTypes.ObjectFieldBuilder<Types, Shape>) => FieldMap; | ||
export declare type InterfaceFieldsShape<Types extends SchemaTypes, Shape> = (t: PothosSchemaTypes.InterfaceFieldBuilder<Types, Shape>) => FieldMap; | ||
export declare type QueryFieldsShape<Types extends SchemaTypes> = (t: PothosSchemaTypes.QueryFieldBuilder<Types, Types['Root']>) => FieldMap; | ||
export declare type MutationFieldsShape<Types extends SchemaTypes> = (t: PothosSchemaTypes.MutationFieldBuilder<Types, Types['Root']>) => FieldMap; | ||
export declare type SubscriptionFieldsShape<Types extends SchemaTypes> = (t: PothosSchemaTypes.SubscriptionFieldBuilder<Types, Types['Root']>) => FieldMap; | ||
export declare type QueryFieldsShape<Types extends SchemaTypes> = (t: PothosSchemaTypes.QueryFieldBuilder<Types, Types["Root"]>) => FieldMap; | ||
export declare type MutationFieldsShape<Types extends SchemaTypes> = (t: PothosSchemaTypes.MutationFieldBuilder<Types, Types["Root"]>) => FieldMap; | ||
export declare type SubscriptionFieldsShape<Types extends SchemaTypes> = (t: PothosSchemaTypes.SubscriptionFieldBuilder<Types, Types["Root"]>) => FieldMap; | ||
export declare type ObjectFieldThunk<Types extends SchemaTypes, Shape> = (t: PothosSchemaTypes.ObjectFieldBuilder<Types, Shape>) => FieldRef<unknown>; | ||
export declare type InterfaceFieldThunk<Types extends SchemaTypes, Shape> = (t: PothosSchemaTypes.InterfaceFieldBuilder<Types, Shape>) => FieldRef<unknown>; | ||
export declare type QueryFieldThunk<Types extends SchemaTypes> = (t: PothosSchemaTypes.QueryFieldBuilder<Types, Types['Root']>) => FieldRef<unknown>; | ||
export declare type MutationFieldThunk<Types extends SchemaTypes> = (t: PothosSchemaTypes.MutationFieldBuilder<Types, Types['Root']>) => FieldRef<unknown>; | ||
export declare type SubscriptionFieldThunk<Types extends SchemaTypes> = (t: PothosSchemaTypes.SubscriptionFieldBuilder<Types, Types['Root']>) => FieldRef<unknown>; | ||
export declare type QueryFieldThunk<Types extends SchemaTypes> = (t: PothosSchemaTypes.QueryFieldBuilder<Types, Types["Root"]>) => FieldRef<unknown>; | ||
export declare type MutationFieldThunk<Types extends SchemaTypes> = (t: PothosSchemaTypes.MutationFieldBuilder<Types, Types["Root"]>) => FieldRef<unknown>; | ||
export declare type SubscriptionFieldThunk<Types extends SchemaTypes> = (t: PothosSchemaTypes.SubscriptionFieldBuilder<Types, Types["Root"]>) => FieldRef<unknown>; | ||
export declare type FieldMap = Record<string, FieldRef>; | ||
export declare type InputFieldMap<Kind extends 'Arg' | 'InputObject' = 'Arg' | 'InputObject'> = Record<string, InputFieldRef<unknown, Kind>>; | ||
export declare type InputFieldMap<Kind extends "Arg" | "InputObject" = "Arg" | "InputObject"> = Record<string, InputFieldRef<unknown, Kind>>; | ||
export declare type FieldOptionsFromKind<Types extends SchemaTypes, ParentShape, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, Kind extends FieldKind, ResolveShape, ResolveReturnShape> = PothosSchemaTypes.FieldOptionsByKind<Types, ParentShape, Type, Nullable, Args, ResolveShape, ResolveReturnShape>[Kind]; | ||
@@ -43,7 +47,7 @@ export declare type ObjectTypeOptions<Types extends SchemaTypes, Param extends ObjectParam<Types>, Shape, Interfaces extends InterfaceParam<Types>[]> = Normalize<(Param extends string ? {} : Param extends ObjectRef<unknown> ? { | ||
}); | ||
export declare type EnumTypeOptions<Types extends SchemaTypes, Param extends EnumParam, Values extends EnumValues<Types>> = Param extends BaseEnum ? Merge<Omit<PothosSchemaTypes.EnumTypeOptions<Types, Values>, 'values'> & { | ||
export declare type EnumTypeOptions<Types extends SchemaTypes, Param extends EnumParam, Values extends EnumValues<Types>> = Param extends BaseEnum ? Merge<Omit<PothosSchemaTypes.EnumTypeOptions<Types, Values>, "values"> & { | ||
name: string; | ||
}> : PothosSchemaTypes.EnumTypeOptions<Types, Values>; | ||
export declare type ArgBuilder<Types extends SchemaTypes> = PothosSchemaTypes.InputFieldBuilder<Types, 'Arg'>['field'] & Omit<PothosSchemaTypes.InputFieldBuilder<Types, 'Arg'>, 'field'>; | ||
export declare type ValidateInterfaces<Shape, Types extends SchemaTypes, Interfaces extends InterfaceParam<Types>> = Interfaces extends InterfaceParam<Types> ? Shape extends GetParentShape<Types, Interfaces> ? Interfaces : 'Object shape must extends interface shape' : never; | ||
export declare type ArgBuilder<Types extends SchemaTypes> = PothosSchemaTypes.InputFieldBuilder<Types, "Arg">["field"] & Omit<PothosSchemaTypes.InputFieldBuilder<Types, "Arg">, "field">; | ||
export declare type ValidateInterfaces<Shape, Types extends SchemaTypes, Interfaces extends InterfaceParam<Types>> = Interfaces extends InterfaceParam<Types> ? Shape extends GetParentShape<Types, Interfaces> ? Interfaces : "Object shape must extends interface shape" : never; | ||
export declare type InputShapeFromFields<Fields extends InputFieldMap> = NormalizeNullableFields<{ | ||
@@ -53,3 +57,3 @@ [K in string & keyof Fields]: InputShapeFromField<Fields[K]>; | ||
export declare type InputFieldsFromShape<Shape extends object> = { | ||
[K in keyof Shape]: InputFieldRef<Shape[K], 'InputObject'>; | ||
[K in keyof Shape]: InputFieldRef<Shape[K], "InputObject">; | ||
}; | ||
@@ -64,2 +68,2 @@ export declare type InputShapeFromField<Field extends InputFieldRef> = Field extends { | ||
}[keyof ParentShape]; | ||
//# sourceMappingURL=builder-options.d.ts.map | ||
//# sourceMappingURL=builder-options.d.ts.map |
import type { GraphQLEnumType, GraphQLEnumTypeConfig, GraphQLEnumValueConfig, GraphQLFieldConfig, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputObjectTypeConfig, GraphQLInterfaceType, GraphQLInterfaceTypeConfig, GraphQLObjectType, GraphQLObjectTypeConfig, GraphQLScalarType, GraphQLScalarTypeConfig, GraphQLUnionType, GraphQLUnionTypeConfig } from 'graphql'; | ||
import type { FieldKind, FieldOptionsFromKind, InputFieldMap } from './builder-options'; | ||
import type { SchemaTypes } from './schema-types'; | ||
import type { FieldNullability, FieldRequiredness, InputType, InputTypeParam, InterfaceParam, ObjectParam, OutputType, TypeParam } from './type-params'; | ||
import type { Merge } from './utils'; | ||
export interface PothosQueryTypeConfig extends Omit<GraphQLObjectTypeConfig<unknown, object>, 'fields' | 'interfaces'> { | ||
kind: 'Query'; | ||
graphqlKind: 'Object'; | ||
import type { FieldKind, FieldOptionsFromKind, InputFieldMap } from './builder-options.js'; | ||
import type { SchemaTypes } from './schema-types.js'; | ||
import type { FieldNullability, FieldRequiredness, InputType, InputTypeParam, InterfaceParam, ObjectParam, OutputType, TypeParam } from './type-params.js'; | ||
import type { Merge } from './utils.js'; | ||
export interface PothosQueryTypeConfig extends Omit<GraphQLObjectTypeConfig<unknown, object>, "fields" | "interfaces"> { | ||
kind: "Query"; | ||
graphqlKind: "Object"; | ||
pothosOptions: PothosSchemaTypes.QueryTypeOptions; | ||
} | ||
export interface PothosMutationTypeConfig extends Omit<GraphQLObjectTypeConfig<unknown, object>, 'fields' | 'interfaces'> { | ||
kind: 'Mutation'; | ||
graphqlKind: 'Object'; | ||
export interface PothosMutationTypeConfig extends Omit<GraphQLObjectTypeConfig<unknown, object>, "fields" | "interfaces"> { | ||
kind: "Mutation"; | ||
graphqlKind: "Object"; | ||
pothosOptions: PothosSchemaTypes.MutationTypeOptions; | ||
} | ||
export interface PothosSubscriptionTypeConfig extends Omit<GraphQLObjectTypeConfig<unknown, object>, 'fields' | 'interfaces'> { | ||
kind: 'Subscription'; | ||
graphqlKind: 'Object'; | ||
export interface PothosSubscriptionTypeConfig extends Omit<GraphQLObjectTypeConfig<unknown, object>, "fields" | "interfaces"> { | ||
kind: "Subscription"; | ||
graphqlKind: "Object"; | ||
pothosOptions: PothosSchemaTypes.SubscriptionTypeOptions; | ||
} | ||
export interface PothosObjectTypeConfig extends Omit<GraphQLObjectTypeConfig<unknown, object>, 'fields' | 'interfaces'> { | ||
kind: 'Object'; | ||
graphqlKind: 'Object'; | ||
export interface PothosObjectTypeConfig extends Omit<GraphQLObjectTypeConfig<unknown, object>, "fields" | "interfaces"> { | ||
kind: "Object"; | ||
graphqlKind: "Object"; | ||
interfaces: InterfaceParam<SchemaTypes>[]; | ||
pothosOptions: PothosSchemaTypes.ObjectTypeOptions; | ||
} | ||
export interface PothosInterfaceTypeConfig extends Omit<GraphQLInterfaceTypeConfig<unknown, object>, 'fields' | 'interfaces'> { | ||
kind: 'Interface'; | ||
graphqlKind: 'Interface'; | ||
export interface PothosInterfaceTypeConfig extends Omit<GraphQLInterfaceTypeConfig<unknown, object>, "fields" | "interfaces"> { | ||
kind: "Interface"; | ||
graphqlKind: "Interface"; | ||
interfaces: InterfaceParam<SchemaTypes>[]; | ||
pothosOptions: PothosSchemaTypes.InterfaceTypeOptions; | ||
} | ||
export interface PothosUnionTypeConfig extends Omit<GraphQLUnionTypeConfig<unknown, object>, 'types'> { | ||
kind: 'Union'; | ||
graphqlKind: 'Union'; | ||
export interface PothosUnionTypeConfig extends Omit<GraphQLUnionTypeConfig<unknown, object>, "types"> { | ||
kind: "Union"; | ||
graphqlKind: "Union"; | ||
types: ObjectParam<SchemaTypes>[]; | ||
@@ -40,18 +40,18 @@ pothosOptions: PothosSchemaTypes.UnionTypeOptions; | ||
export interface PothosEnumTypeConfig extends GraphQLEnumTypeConfig { | ||
kind: 'Enum'; | ||
graphqlKind: 'Enum'; | ||
kind: "Enum"; | ||
graphqlKind: "Enum"; | ||
pothosOptions: PothosSchemaTypes.EnumTypeOptions; | ||
} | ||
export interface PothosScalarTypeConfig extends GraphQLScalarTypeConfig<unknown, unknown> { | ||
kind: 'Scalar'; | ||
graphqlKind: 'Scalar'; | ||
kind: "Scalar"; | ||
graphqlKind: "Scalar"; | ||
pothosOptions: PothosSchemaTypes.ScalarTypeOptions; | ||
} | ||
export interface PothosInputObjectTypeConfig extends Omit<GraphQLInputObjectTypeConfig, 'fields'> { | ||
kind: 'InputObject'; | ||
graphqlKind: 'InputObject'; | ||
export interface PothosInputObjectTypeConfig extends Omit<GraphQLInputObjectTypeConfig, "fields"> { | ||
kind: "InputObject"; | ||
graphqlKind: "InputObject"; | ||
pothosOptions: PothosSchemaTypes.InputObjectTypeOptions; | ||
} | ||
export declare type PothosTypeConfig = PothosEnumTypeConfig | PothosInputObjectTypeConfig | PothosInterfaceTypeConfig | PothosMutationTypeConfig | PothosObjectTypeConfig | PothosQueryTypeConfig | PothosScalarTypeConfig | PothosSubscriptionTypeConfig | PothosUnionTypeConfig; | ||
export declare type PothosTypeKind = PothosTypeConfig['kind']; | ||
export declare type PothosTypeKind = PothosTypeConfig["kind"]; | ||
export declare type PothosKindToGraphQLTypeClass<T extends PothosTypeKind> = { | ||
@@ -66,3 +66,3 @@ Object: GraphQLObjectType; | ||
export declare type PothosFieldKindToConfig<Types extends SchemaTypes, Kind extends FieldKind> = { | ||
[K in FieldKind]: Merge<Omit<GraphQLFieldConfig<unknown, object>, 'args' | 'type'> & { | ||
[K in FieldKind]: Merge<Omit<GraphQLFieldConfig<unknown, object>, "args" | "type"> & { | ||
kind: K; | ||
@@ -74,8 +74,10 @@ graphqlKind: PothosSchemaTypes.PothosKindToGraphQLType[K]; | ||
args: Record<string, PothosInputFieldConfig<Types>>; | ||
pothosOptions: FieldOptionsFromKind<Types, unknown, TypeParam<Types>, FieldNullability<[unknown]>, InputFieldMap, K, unknown, unknown>; | ||
pothosOptions: FieldOptionsFromKind<Types, unknown, TypeParam<Types>, FieldNullability<[ | ||
unknown | ||
]>, InputFieldMap, K, unknown, unknown>; | ||
}>; | ||
}[Kind]; | ||
export interface PothosInputFieldConfig<Types extends SchemaTypes> extends Omit<GraphQLInputFieldConfig, 'type'> { | ||
kind: 'Arg' | 'InputObject'; | ||
graphqlKind: 'Arg' | 'InputObject'; | ||
export interface PothosInputFieldConfig<Types extends SchemaTypes> extends Omit<GraphQLInputFieldConfig, "type"> { | ||
kind: "Arg" | "InputObject"; | ||
graphqlKind: "Arg" | "InputObject"; | ||
name: string; | ||
@@ -85,3 +87,5 @@ parentField: string | undefined; | ||
type: PothosInputFieldType<Types>; | ||
pothosOptions: PothosSchemaTypes.InputFieldOptionsByKind<Types, InputTypeParam<Types>, FieldRequiredness<[unknown]>>[keyof PothosSchemaTypes.InputFieldOptionsByKind]; | ||
pothosOptions: PothosSchemaTypes.InputFieldOptionsByKind<Types, InputTypeParam<Types>, FieldRequiredness<[ | ||
unknown | ||
]>>[keyof PothosSchemaTypes.InputFieldOptionsByKind]; | ||
} | ||
@@ -93,9 +97,9 @@ export interface PothosEnumValueConfig<Types extends SchemaTypes> extends GraphQLEnumValueConfig { | ||
export declare type PothosFieldConfig<Types extends SchemaTypes> = PothosInputFieldConfig<Types> | PothosOutputFieldConfig<Types>; | ||
export declare type GraphQLFieldKind = PothosFieldConfig<SchemaTypes>['graphqlKind']; | ||
export declare type GraphQLFieldKind = PothosFieldConfig<SchemaTypes>["graphqlKind"]; | ||
export declare type PothosOutputFieldType<Types extends SchemaTypes> = { | ||
kind: 'Enum' | 'Interface' | 'Object' | 'Scalar' | 'Union'; | ||
kind: "Enum" | "Interface" | "Object" | "Scalar" | "Union"; | ||
ref: OutputType<Types>; | ||
nullable: boolean; | ||
} | { | ||
kind: 'List'; | ||
kind: "List"; | ||
type: PothosNameOutputFieldType<Types>; | ||
@@ -105,10 +109,10 @@ nullable: boolean; | ||
export declare type PothosNameOutputFieldType<Types extends SchemaTypes> = Exclude<PothosOutputFieldType<Types>, { | ||
kind: 'List'; | ||
kind: "List"; | ||
}>; | ||
export declare type PothosInputFieldType<Types extends SchemaTypes> = { | ||
kind: 'Enum' | 'InputObject' | 'Scalar'; | ||
kind: "Enum" | "InputObject" | "Scalar"; | ||
ref: InputType<Types>; | ||
required: boolean; | ||
} | { | ||
kind: 'List'; | ||
kind: "List"; | ||
type: PothosNameInputFieldType<Types>; | ||
@@ -118,4 +122,4 @@ required: boolean; | ||
export declare type PothosNameInputFieldType<Types extends SchemaTypes> = Exclude<PothosInputFieldType<Types>, { | ||
kind: 'List'; | ||
kind: "List"; | ||
}>; | ||
//# sourceMappingURL=configs.d.ts.map | ||
//# sourceMappingURL=configs.d.ts.map |
@@ -1,14 +0,14 @@ | ||
import type Builder from '../../builder'; | ||
import type InternalFieldBuilder from '../../fieldUtils/builder'; | ||
import type InternalInputFieldBuilder from '../../fieldUtils/input'; | ||
import type InternalRootFieldBuilder from '../../fieldUtils/root'; | ||
import type InternalBaseRef from '../../refs/base'; | ||
import type InternalEnumRef from '../../refs/enum'; | ||
import type InternalInputObjectRef from '../../refs/input-object'; | ||
import type InternalInterfaceRef from '../../refs/interface'; | ||
import type InternalObjectRef from '../../refs/object'; | ||
import type InternalScalarRef from '../../refs/scalar'; | ||
import type InternalUnionRef from '../../refs/union'; | ||
import type { FieldKind } from '../builder-options'; | ||
import type { SchemaTypes } from '../schema-types'; | ||
import type Builder from '../../builder.js'; | ||
import type InternalFieldBuilder from '../../fieldUtils/builder.js'; | ||
import type InternalInputFieldBuilder from '../../fieldUtils/input.js'; | ||
import type InternalRootFieldBuilder from '../../fieldUtils/root.js'; | ||
import type InternalBaseRef from '../../refs/base.js'; | ||
import type InternalEnumRef from '../../refs/enum.js'; | ||
import type InternalInputObjectRef from '../../refs/input-object.js'; | ||
import type InternalInterfaceRef from '../../refs/interface.js'; | ||
import type InternalObjectRef from '../../refs/object.js'; | ||
import type InternalScalarRef from '../../refs/scalar.js'; | ||
import type InternalUnionRef from '../../refs/union.js'; | ||
import type { FieldKind } from '../builder-options.js'; | ||
import type { SchemaTypes } from '../schema-types.js'; | ||
declare global { | ||
@@ -22,13 +22,13 @@ export namespace PothosSchemaTypes { | ||
} | ||
interface QueryFieldBuilder<Types extends SchemaTypes, ParentShape> extends RootFieldBuilder<Types, ParentShape, 'Query'> { | ||
interface QueryFieldBuilder<Types extends SchemaTypes, ParentShape> extends RootFieldBuilder<Types, ParentShape, "Query"> { | ||
} | ||
interface MutationFieldBuilder<Types extends SchemaTypes, ParentShape> extends RootFieldBuilder<Types, ParentShape, 'Mutation'> { | ||
interface MutationFieldBuilder<Types extends SchemaTypes, ParentShape> extends RootFieldBuilder<Types, ParentShape, "Mutation"> { | ||
} | ||
interface SubscriptionFieldBuilder<Types extends SchemaTypes, ParentShape> extends RootFieldBuilder<Types, ParentShape, 'Subscription'> { | ||
interface SubscriptionFieldBuilder<Types extends SchemaTypes, ParentShape> extends RootFieldBuilder<Types, ParentShape, "Subscription"> { | ||
} | ||
interface ObjectFieldBuilder<Types extends SchemaTypes, ParentShape> extends FieldBuilder<Types, ParentShape, 'Object'> { | ||
interface ObjectFieldBuilder<Types extends SchemaTypes, ParentShape> extends FieldBuilder<Types, ParentShape, "Object"> { | ||
} | ||
interface InterfaceFieldBuilder<Types extends SchemaTypes, ParentShape> extends FieldBuilder<Types, ParentShape, 'Interface'> { | ||
interface InterfaceFieldBuilder<Types extends SchemaTypes, ParentShape> extends FieldBuilder<Types, ParentShape, "Interface"> { | ||
} | ||
interface InputFieldBuilder<Types extends SchemaTypes, Kind extends 'Arg' | 'InputObject'> extends InternalInputFieldBuilder<Types, Kind> { | ||
interface InputFieldBuilder<Types extends SchemaTypes, Kind extends "Arg" | "InputObject"> extends InternalInputFieldBuilder<Types, Kind> { | ||
} | ||
@@ -51,2 +51,2 @@ interface BaseTypeRef extends InternalBaseRef { | ||
} | ||
//# sourceMappingURL=classes.d.ts.map | ||
//# sourceMappingURL=classes.d.ts.map |
import type { GraphQLFieldExtensions } from 'graphql'; | ||
import type { InputFieldMap, InputShapeFromFields, Resolver, Subscriber } from '../builder-options'; | ||
import type { SchemaTypes } from '../schema-types'; | ||
import type { FieldNullability, FieldRequiredness, InputShapeFromTypeParam, InputType, ShapeFromTypeParam, TypeParam } from '../type-params'; | ||
import type { InputFieldMap, InputShapeFromFields, Resolver, Subscriber } from '../builder-options.js'; | ||
import type { SchemaTypes } from '../schema-types.js'; | ||
import type { FieldNullability, FieldRequiredness, InputShapeFromTypeParam, InputType, ShapeFromTypeParam, TypeParam } from '../type-params.js'; | ||
declare global { | ||
@@ -19,3 +19,3 @@ export namespace PothosSchemaTypes { | ||
/** extensions for this field for use by directives, server plugins or other tools that depend on extensions */ | ||
extensions?: GraphQLFieldExtensions<ParentShape, Types['Context'], InputShapeFromFields<Args>>; | ||
extensions?: GraphQLFieldExtensions<ParentShape, Types["Context"], InputShapeFromFields<Args>>; | ||
/** | ||
@@ -28,3 +28,3 @@ * Resolver function for this field | ||
*/ | ||
resolve?: Resolver<ResolveShape, InputShapeFromFields<Args>, Types['Context'], ShapeFromTypeParam<Types, Type, Nullable>, ResolveReturnShape>; | ||
resolve?: Resolver<ResolveShape, InputShapeFromFields<Args>, Types["Context"], ShapeFromTypeParam<Types, Type, Nullable>, ResolveReturnShape>; | ||
} | ||
@@ -39,5 +39,5 @@ interface ObjectFieldOptions<Types extends SchemaTypes, ParentShape, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, ResolveReturnShape> extends FieldOptions<Types, ParentShape, Type, Nullable, Args, ParentShape, ResolveReturnShape> { | ||
*/ | ||
resolve: Resolver<ParentShape, InputShapeFromFields<Args>, Types['Context'], ShapeFromTypeParam<Types, Type, Nullable>, ResolveReturnShape>; | ||
resolve: Resolver<ParentShape, InputShapeFromFields<Args>, Types["Context"], ShapeFromTypeParam<Types, Type, Nullable>, ResolveReturnShape>; | ||
} | ||
interface QueryFieldOptions<Types extends SchemaTypes, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, ResolveReturnShape> extends FieldOptions<Types, Types['Root'], Type, Nullable, Args, Types['Root'], ResolveReturnShape> { | ||
interface QueryFieldOptions<Types extends SchemaTypes, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, ResolveReturnShape> extends FieldOptions<Types, Types["Root"], Type, Nullable, Args, Types["Root"], ResolveReturnShape> { | ||
/** | ||
@@ -50,5 +50,5 @@ * Resolver function for this field | ||
*/ | ||
resolve: Resolver<Types['Root'], InputShapeFromFields<Args>, Types['Context'], ShapeFromTypeParam<Types, Type, Nullable>, ResolveReturnShape>; | ||
resolve: Resolver<Types["Root"], InputShapeFromFields<Args>, Types["Context"], ShapeFromTypeParam<Types, Type, Nullable>, ResolveReturnShape>; | ||
} | ||
interface MutationFieldOptions<Types extends SchemaTypes, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, ResolveReturnShape> extends FieldOptions<Types, Types['Root'], Type, Nullable, Args, Types['Root'], ResolveReturnShape> { | ||
interface MutationFieldOptions<Types extends SchemaTypes, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, ResolveReturnShape> extends FieldOptions<Types, Types["Root"], Type, Nullable, Args, Types["Root"], ResolveReturnShape> { | ||
/** | ||
@@ -61,3 +61,3 @@ * Resolver function for this field | ||
*/ | ||
resolve: Resolver<Types['Root'], InputShapeFromFields<Args>, Types['Context'], ShapeFromTypeParam<Types, Type, Nullable>, ResolveReturnShape>; | ||
resolve: Resolver<Types["Root"], InputShapeFromFields<Args>, Types["Context"], ShapeFromTypeParam<Types, Type, Nullable>, ResolveReturnShape>; | ||
} | ||
@@ -72,5 +72,5 @@ interface InterfaceFieldOptions<Types extends SchemaTypes, ParentShape, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, ResolveReturnShape> extends FieldOptions<Types, ParentShape, Type, Nullable, Args, ParentShape, ResolveReturnShape> { | ||
*/ | ||
resolve?: Resolver<ParentShape, InputShapeFromFields<Args>, Types['Context'], ShapeFromTypeParam<Types, Type, Nullable>, ResolveReturnShape>; | ||
resolve?: Resolver<ParentShape, InputShapeFromFields<Args>, Types["Context"], ShapeFromTypeParam<Types, Type, Nullable>, ResolveReturnShape>; | ||
} | ||
interface SubscriptionFieldOptions<Types extends SchemaTypes, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, ResolveShape, ResolveReturnShape> extends FieldOptions<Types, Types['Root'], Type, Nullable, Args, ResolveShape, ResolveReturnShape> { | ||
interface SubscriptionFieldOptions<Types extends SchemaTypes, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, ResolveShape, ResolveReturnShape> extends FieldOptions<Types, Types["Root"], Type, Nullable, Args, ResolveShape, ResolveReturnShape> { | ||
/** | ||
@@ -83,3 +83,3 @@ * Resolver function for this field | ||
*/ | ||
resolve: Resolver<ResolveShape, InputShapeFromFields<Args>, Types['Context'], ShapeFromTypeParam<Types, Type, Nullable>, ResolveReturnShape>; | ||
resolve: Resolver<ResolveShape, InputShapeFromFields<Args>, Types["Context"], ShapeFromTypeParam<Types, Type, Nullable>, ResolveReturnShape>; | ||
/** | ||
@@ -92,3 +92,3 @@ * Resolver function for this field | ||
*/ | ||
subscribe: Subscriber<Types['Root'], InputShapeFromFields<Args>, Types['Context'], ResolveShape>; | ||
subscribe: Subscriber<Types["Root"], InputShapeFromFields<Args>, Types["Context"], ResolveShape>; | ||
} | ||
@@ -102,3 +102,7 @@ interface FieldOptionsByKind<Types extends SchemaTypes, ParentShape, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, ResolveShape, ResolveReturnShape> { | ||
} | ||
interface InputFieldOptions<Types extends SchemaTypes = SchemaTypes, Type extends InputType<Types> | [InputType<Types>] = InputType<Types> | [InputType<Types>], Req extends FieldRequiredness<Type> = FieldRequiredness<Type>> { | ||
interface InputFieldOptions<Types extends SchemaTypes = SchemaTypes, Type extends InputType<Types> | [ | ||
InputType<Types> | ||
] = InputType<Types> | [ | ||
InputType<Types> | ||
], Req extends FieldRequiredness<Type> = FieldRequiredness<Type>> { | ||
/** The type for this field */ | ||
@@ -117,7 +121,19 @@ type: Type; | ||
} | ||
interface ArgFieldOptions<Types extends SchemaTypes = SchemaTypes, Type extends InputType<Types> | [InputType<Types>] = InputType<Types> | [InputType<Types>], Req extends FieldRequiredness<Type> = FieldRequiredness<Type>> extends InputFieldOptions<Types, Type, Req> { | ||
interface ArgFieldOptions<Types extends SchemaTypes = SchemaTypes, Type extends InputType<Types> | [ | ||
InputType<Types> | ||
] = InputType<Types> | [ | ||
InputType<Types> | ||
], Req extends FieldRequiredness<Type> = FieldRequiredness<Type>> extends InputFieldOptions<Types, Type, Req> { | ||
} | ||
interface InputObjectFieldOptions<Types extends SchemaTypes = SchemaTypes, Type extends InputType<Types> | [InputType<Types>] = InputType<Types> | [InputType<Types>], Req extends FieldRequiredness<Type> = FieldRequiredness<Type>> extends InputFieldOptions<Types, Type, Req> { | ||
interface InputObjectFieldOptions<Types extends SchemaTypes = SchemaTypes, Type extends InputType<Types> | [ | ||
InputType<Types> | ||
] = InputType<Types> | [ | ||
InputType<Types> | ||
], Req extends FieldRequiredness<Type> = FieldRequiredness<Type>> extends InputFieldOptions<Types, Type, Req> { | ||
} | ||
interface InputFieldOptionsByKind<Types extends SchemaTypes = SchemaTypes, Type extends InputType<Types> | [InputType<Types>] = InputType<Types> | [InputType<Types>], Req extends FieldRequiredness<Type> = FieldRequiredness<Type>> { | ||
interface InputFieldOptionsByKind<Types extends SchemaTypes = SchemaTypes, Type extends InputType<Types> | [ | ||
InputType<Types> | ||
] = InputType<Types> | [ | ||
InputType<Types> | ||
], Req extends FieldRequiredness<Type> = FieldRequiredness<Type>> { | ||
Arg: ArgFieldOptions<Types, Type, Req>; | ||
@@ -128,2 +144,2 @@ InputObject: InputObjectFieldOptions<Types, Type, Req>; | ||
} | ||
//# sourceMappingURL=field-options.d.ts.map | ||
//# sourceMappingURL=field-options.d.ts.map |
@@ -1,5 +0,5 @@ | ||
import './type-options'; | ||
import './field-options'; | ||
import './classes'; | ||
import './schema-types'; | ||
//# sourceMappingURL=index.d.ts.map | ||
import './type-options.js'; | ||
import './field-options.js'; | ||
import './classes.js'; | ||
import './schema-types.js'; | ||
//# sourceMappingURL=index.d.ts.map |
import type { GraphQLDirective } from 'graphql'; | ||
import type { PluginConstructorMap } from '../plugins'; | ||
import type { MergedScalars, SchemaTypes } from '../schema-types'; | ||
import type { IsStrictMode } from '../utils'; | ||
import type { PluginConstructorMap } from '../plugins.js'; | ||
import type { MergedScalars, SchemaTypes } from '../schema-types.js'; | ||
import type { IsStrictMode } from '../utils.js'; | ||
declare global { | ||
@@ -9,5 +9,5 @@ export namespace PothosSchemaTypes { | ||
plugins?: (keyof PluginConstructorMap<Types>)[]; | ||
defaultFieldNullability: false extends Types['DefaultFieldNullability'] ? never : Types['DefaultFieldNullability']; | ||
defaultInputFieldRequiredness: false extends Types['DefaultInputFieldRequiredness'] ? never : Types['DefaultInputFieldRequiredness']; | ||
notStrict: IsStrictMode extends true ? never : 'Pothos may not work correctly when strict mode is not enabled in tsconfig.json'; | ||
defaultFieldNullability: false extends Types["DefaultFieldNullability"] ? never : Types["DefaultFieldNullability"]; | ||
defaultInputFieldRequiredness: false extends Types["DefaultInputFieldRequiredness"] ? never : Types["DefaultInputFieldRequiredness"]; | ||
notStrict: IsStrictMode extends true ? never : "Pothos may not work correctly when strict mode is not enabled in tsconfig.json"; | ||
} | ||
@@ -22,11 +22,11 @@ interface BuildSchemaOptions<Types extends SchemaTypes> { | ||
interface PothosKindToGraphQLType { | ||
Object: 'Object'; | ||
Query: 'Object'; | ||
Mutation: 'Object'; | ||
Subscription: 'Object'; | ||
Interface: 'Interface'; | ||
Union: 'Union'; | ||
Enum: 'Enum'; | ||
Scalar: 'Scalar'; | ||
InputObject: 'InputObject'; | ||
Object: "Object"; | ||
Query: "Object"; | ||
Mutation: "Object"; | ||
Subscription: "Object"; | ||
Interface: "Interface"; | ||
Union: "Union"; | ||
Enum: "Enum"; | ||
Scalar: "Scalar"; | ||
InputObject: "InputObject"; | ||
} | ||
@@ -47,8 +47,8 @@ interface UserSchemaTypes { | ||
Scalars: MergedScalars<PartialTypes>; | ||
Objects: PartialTypes['Objects'] & {}; | ||
Interfaces: PartialTypes['Interfaces'] & {}; | ||
Root: PartialTypes['Root'] & {}; | ||
Context: PartialTypes['Context'] & {}; | ||
DefaultFieldNullability: PartialTypes['DefaultFieldNullability'] extends true ? true : false; | ||
DefaultInputFieldRequiredness: PartialTypes['DefaultInputFieldRequiredness'] extends true ? true : false; | ||
Objects: PartialTypes["Objects"] & {}; | ||
Interfaces: PartialTypes["Interfaces"] & {}; | ||
Root: PartialTypes["Root"] & {}; | ||
Context: PartialTypes["Context"] & {}; | ||
DefaultFieldNullability: PartialTypes["DefaultFieldNullability"] extends true ? true : false; | ||
DefaultInputFieldRequiredness: PartialTypes["DefaultInputFieldRequiredness"] extends true ? true : false; | ||
outputShapes: { | ||
@@ -59,5 +59,5 @@ [K in keyof MergedScalars<PartialTypes>]: MergedScalars<PartialTypes>[K] extends { | ||
} & { | ||
[K in keyof PartialTypes['Objects']]: PartialTypes['Objects'][K]; | ||
[K in keyof PartialTypes["Objects"]]: PartialTypes["Objects"][K]; | ||
} & { | ||
[K in keyof PartialTypes['Interfaces']]: PartialTypes['Interfaces'][K]; | ||
[K in keyof PartialTypes["Interfaces"]]: PartialTypes["Interfaces"][K]; | ||
}; | ||
@@ -72,2 +72,2 @@ inputShapes: { | ||
} | ||
//# sourceMappingURL=schema-types.d.ts.map | ||
//# sourceMappingURL=schema-types.d.ts.map |
import type { GraphQLIsTypeOfFn, GraphQLResolveInfo, GraphQLScalarLiteralParser, GraphQLScalarValueParser, GraphQLUnionType } from 'graphql'; | ||
import type { EnumValues, InputFieldMap, InterfaceFieldsShape, MutationFieldsShape, ObjectFieldsShape, QueryFieldsShape, SubscriptionFieldsShape, ValidateInterfaces } from '../builder-options'; | ||
import type { RootName, SchemaTypes } from '../schema-types'; | ||
import type { InterfaceParam, ObjectParam, ParentShape } from '../type-params'; | ||
import type { MaybePromise } from '../utils'; | ||
import type { EnumValues, InputFieldMap, InterfaceFieldsShape, MutationFieldsShape, ObjectFieldsShape, QueryFieldsShape, SubscriptionFieldsShape, ValidateInterfaces } from '../builder-options.js'; | ||
import type { RootName, SchemaTypes } from '../schema-types.js'; | ||
import type { InterfaceParam, ObjectParam, ParentShape } from '../type-params.js'; | ||
import type { MaybePromise } from '../utils.js'; | ||
declare global { | ||
@@ -18,5 +18,5 @@ export namespace PothosSchemaTypes { | ||
interfaces?: undefined; | ||
isTypeOf?: GraphQLIsTypeOfFn<unknown, Types['Context']>; | ||
isTypeOf?: GraphQLIsTypeOfFn<unknown, Types["Context"]>; | ||
} | ||
interface ObjectTypeWithInterfaceOptions<Types extends SchemaTypes = SchemaTypes, Shape = unknown, Interfaces extends InterfaceParam<Types>[] = InterfaceParam<Types>[]> extends Omit<ObjectTypeOptions<Types, Shape>, 'interfaces'> { | ||
interface ObjectTypeWithInterfaceOptions<Types extends SchemaTypes = SchemaTypes, Shape = unknown, Interfaces extends InterfaceParam<Types>[] = InterfaceParam<Types>[]> extends Omit<ObjectTypeOptions<Types, Shape>, "interfaces"> { | ||
interfaces: (() => Interfaces & ValidateInterfaces<Shape, Types, Interfaces[number]>[]) | (Interfaces & ValidateInterfaces<Shape, Types, Interfaces[number]>[]); | ||
@@ -26,13 +26,13 @@ } | ||
} | ||
interface QueryTypeOptions<Types extends SchemaTypes = SchemaTypes> extends RootTypeOptions<Types, 'Query'> { | ||
interface QueryTypeOptions<Types extends SchemaTypes = SchemaTypes> extends RootTypeOptions<Types, "Query"> { | ||
fields?: QueryFieldsShape<Types>; | ||
} | ||
interface MutationTypeOptions<Types extends SchemaTypes = SchemaTypes> extends RootTypeOptions<Types, 'Mutation'> { | ||
interface MutationTypeOptions<Types extends SchemaTypes = SchemaTypes> extends RootTypeOptions<Types, "Mutation"> { | ||
fields?: MutationFieldsShape<Types>; | ||
} | ||
interface SubscriptionTypeOptions<Types extends SchemaTypes = SchemaTypes> extends RootTypeOptions<Types, 'Subscription'> { | ||
interface SubscriptionTypeOptions<Types extends SchemaTypes = SchemaTypes> extends RootTypeOptions<Types, "Subscription"> { | ||
fields?: SubscriptionFieldsShape<Types>; | ||
} | ||
interface InputObjectTypeOptions<Types extends SchemaTypes = SchemaTypes, Fields extends InputFieldMap = InputFieldMap> extends BaseTypeOptions<Types> { | ||
fields: (t: InputFieldBuilder<Types, 'InputObject'>) => Fields; | ||
fields: (t: InputFieldBuilder<Types, "InputObject">) => Fields; | ||
} | ||
@@ -42,7 +42,7 @@ interface InterfaceTypeOptions<Types extends SchemaTypes = SchemaTypes, Shape = unknown, Interfaces extends InterfaceParam<Types>[] = InterfaceParam<Types>[], ResolveType = unknown> extends BaseTypeOptions<Types> { | ||
interfaces?: (Interfaces & ValidateInterfaces<Shape, Types, Interfaces[number]>[]) | (() => Interfaces & ValidateInterfaces<Shape, Types, Interfaces[number]>[]); | ||
resolveType?: ResolveType & ((parent: Shape, context: Types['Context'], info: GraphQLResolveInfo, type: GraphQLUnionType) => MaybePromise<ObjectParam<Types> | string | null | undefined>); | ||
resolveType?: ResolveType & ((parent: Shape, context: Types["Context"], info: GraphQLResolveInfo, type: GraphQLUnionType) => MaybePromise<ObjectParam<Types> | string | null | undefined>); | ||
} | ||
interface UnionTypeOptions<Types extends SchemaTypes = SchemaTypes, Member extends ObjectParam<Types> = ObjectParam<Types>, ResolveType = unknown> extends BaseTypeOptions<Types> { | ||
types: Member[]; | ||
resolveType?: ResolveType & ((parent: ParentShape<Types, Member>, context: Types['Context'], info: GraphQLResolveInfo, type: GraphQLUnionType) => MaybePromise<Member | string | null | undefined>); | ||
resolveType?: ResolveType & ((parent: ParentShape<Types, Member>, context: Types["Context"], info: GraphQLResolveInfo, type: GraphQLUnionType) => MaybePromise<Member | string | null | undefined>); | ||
} | ||
@@ -62,2 +62,2 @@ interface ScalarTypeOptions<Types extends SchemaTypes = SchemaTypes, ScalarInputShape = unknown, ScalarOutputShape = unknown> extends BaseTypeOptions<Types> { | ||
} | ||
//# sourceMappingURL=type-options.d.ts.map | ||
//# sourceMappingURL=type-options.d.ts.map |
@@ -1,8 +0,8 @@ | ||
import './global'; | ||
export * from './builder-options'; | ||
export * from './configs'; | ||
export * from './plugins'; | ||
export * from './schema-types'; | ||
export * from './type-params'; | ||
export * from './utils'; | ||
//# sourceMappingURL=index.d.ts.map | ||
import './global/index.js'; | ||
export * from './builder-options.js'; | ||
export * from './configs.js'; | ||
export * from './plugins.js'; | ||
export * from './schema-types.js'; | ||
export * from './type-params.js'; | ||
export * from './utils.js'; | ||
//# sourceMappingURL=index.d.ts.map |
import type { GraphQLFieldResolver, GraphQLResolveInfo } from 'graphql'; | ||
import type BuildCache from '../build-cache'; | ||
import type { BasePlugin } from '../plugins/plugin'; | ||
import type { PothosObjectTypeConfig } from './configs'; | ||
import type { SchemaTypes } from './schema-types'; | ||
import type { MaybePromise } from './utils'; | ||
import type BuildCache from '../build-cache.js'; | ||
import type { BasePlugin } from '../plugins/plugin.js'; | ||
import type { PothosObjectTypeConfig } from './configs.js'; | ||
import type { SchemaTypes } from './schema-types.js'; | ||
import type { MaybePromise } from './utils.js'; | ||
/** | ||
@@ -11,3 +11,3 @@ * @deprecated This will be replaced by by wrapResolve, wrapSubscribe, and wrapResolveType | ||
export interface ResolveHooks<Types extends SchemaTypes, T> { | ||
overwriteResolve?: (parent: unknown, args: {}, context: Types['Context'], info: GraphQLResolveInfo, originalResolver: GraphQLFieldResolver<unknown, Types['Context']>) => unknown; | ||
overwriteResolve?: (parent: unknown, args: {}, context: Types["Context"], info: GraphQLResolveInfo, originalResolver: GraphQLFieldResolver<unknown, Types["Context"]>) => unknown; | ||
onResolve?: (value: unknown) => MaybePromise<void>; | ||
@@ -21,3 +21,3 @@ onChild?: (child: unknown, index: number | null, type: PothosObjectTypeConfig, update: (value: unknown) => void) => MaybePromise<T | null>; | ||
export interface SubscribeHooks<Types extends SchemaTypes, T> { | ||
overwriteSubscribe?: (parent: unknown, args: {}, context: Types['Context'], info: GraphQLResolveInfo, originalResolver: GraphQLFieldResolver<unknown, Types['Context']>) => unknown; | ||
overwriteSubscribe?: (parent: unknown, args: {}, context: Types["Context"], info: GraphQLResolveInfo, originalResolver: GraphQLFieldResolver<unknown, Types["Context"]>) => unknown; | ||
onSubscribe?: (value: unknown) => MaybePromise<void>; | ||
@@ -33,2 +33,2 @@ onValue?: (child: unknown) => MaybePromise<T | null>; | ||
export declare type PluginName = keyof PluginConstructorMap<SchemaTypes>; | ||
//# sourceMappingURL=plugins.d.ts.map | ||
//# sourceMappingURL=plugins.d.ts.map |
@@ -45,4 +45,4 @@ export interface SchemaTypes extends PothosSchemaTypes.UserSchemaTypes { | ||
} | ||
export declare type MergedScalars<PartialTypes extends Partial<PothosSchemaTypes.UserSchemaTypes>> = SchemaTypes['Scalars'] & { | ||
[K in keyof DefaultScalars | keyof PartialTypes['Scalars']]: K extends keyof PartialTypes['Scalars'] ? PartialTypes['Scalars'][K] : K extends keyof DefaultScalars ? DefaultScalars[K] : never; | ||
export declare type MergedScalars<PartialTypes extends Partial<PothosSchemaTypes.UserSchemaTypes>> = SchemaTypes["Scalars"] & { | ||
[K in keyof DefaultScalars | keyof PartialTypes["Scalars"]]: K extends keyof PartialTypes["Scalars"] ? PartialTypes["Scalars"][K] : K extends keyof DefaultScalars ? DefaultScalars[K] : never; | ||
}; | ||
@@ -71,5 +71,5 @@ export interface DefaultScalars { | ||
} | ||
export declare type BaseScalarNames = 'Boolean' | 'Float' | 'ID' | 'Int' | 'String'; | ||
export declare type ScalarName<Types extends SchemaTypes> = string & (BaseScalarNames | keyof Types['Scalars']); | ||
export declare type RootName = 'Mutation' | 'Query' | 'Subscription'; | ||
//# sourceMappingURL=schema-types.d.ts.map | ||
export declare type BaseScalarNames = "Boolean" | "Float" | "ID" | "Int" | "String"; | ||
export declare type ScalarName<Types extends SchemaTypes> = string & (BaseScalarNames | keyof Types["Scalars"]); | ||
export declare type RootName = "Mutation" | "Query" | "Subscription"; | ||
//# sourceMappingURL=schema-types.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import type InterfaceRef from '../refs/interface'; | ||
import type ObjectRef from '../refs/object'; | ||
import type { RootName, SchemaTypes } from './schema-types'; | ||
import type InterfaceRef from '../refs/interface.js'; | ||
import type ObjectRef from '../refs/object.js'; | ||
import type { RootName, SchemaTypes } from './schema-types.js'; | ||
export declare const outputShapeKey: unique symbol; | ||
@@ -15,3 +15,3 @@ export declare const parentShapeKey: unique symbol; | ||
[outputShapeKey]: infer V; | ||
} ? V : U : T extends keyof Types['outputShapes'] ? Types['outputShapes'][T] : T extends BaseEnum ? ValuesFromEnum<T> : never; | ||
} ? V : U : T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends BaseEnum ? ValuesFromEnum<T> : never; | ||
export declare type ParentShape<Types extends SchemaTypes, T> = T extends { | ||
@@ -27,3 +27,3 @@ [parentShapeKey]: infer U; | ||
[inputShapeKey]: infer V; | ||
} ? V : U : T extends keyof Types['inputShapes'] ? Types['inputShapes'][T] : T extends BaseEnum ? ValuesFromEnum<T> : never; | ||
} ? V : U : T extends keyof Types["inputShapes"] ? Types["inputShapes"][T] : T extends BaseEnum ? ValuesFromEnum<T> : never; | ||
export interface OutputRefShape<T> { | ||
@@ -38,3 +38,3 @@ [outputShapeKey]: T; | ||
name: string; | ||
kind: 'Enum' | 'Interface' | 'Object' | 'Scalar' | 'Union'; | ||
kind: "Enum" | "Interface" | "Object" | "Scalar" | "Union"; | ||
} | ||
@@ -44,15 +44,19 @@ export interface InputRef<T = unknown> { | ||
name: string; | ||
kind: 'Enum' | 'InputObject' | 'Scalar'; | ||
kind: "Enum" | "InputObject" | "Scalar"; | ||
} | ||
export declare type OutputType<Types extends SchemaTypes> = BaseEnum | keyof Types['outputShapes'] | (new (...args: any[]) => any) | { | ||
export declare type OutputType<Types extends SchemaTypes> = BaseEnum | keyof Types["outputShapes"] | (new (...args: any[]) => any) | { | ||
[outputShapeKey]: unknown; | ||
}; | ||
export declare type InputType<Types extends SchemaTypes> = BaseEnum | keyof Types['inputShapes'] | { | ||
export declare type InputType<Types extends SchemaTypes> = BaseEnum | keyof Types["inputShapes"] | { | ||
[inputShapeKey]: unknown; | ||
}; | ||
export declare type ConfigurableRef<Types extends SchemaTypes> = InputType<Types> | OutputType<Types> | RootName; | ||
export declare type TypeParam<Types extends SchemaTypes> = OutputType<Types> | [OutputType<Types>]; | ||
export declare type InputTypeParam<Types extends SchemaTypes> = InputType<Types> | [InputType<Types>]; | ||
export declare type ObjectParam<Types extends SchemaTypes> = Extract<OutputType<Types>, keyof Types['Objects']> | ObjectRef<unknown> | (new (...args: any[]) => any); | ||
export declare type InterfaceParam<Types extends SchemaTypes> = Extract<OutputType<Types>, keyof Types['Interfaces']> | InterfaceRef<unknown> | (new (...args: any[]) => unknown); | ||
export declare type TypeParam<Types extends SchemaTypes> = OutputType<Types> | [ | ||
OutputType<Types> | ||
]; | ||
export declare type InputTypeParam<Types extends SchemaTypes> = InputType<Types> | [ | ||
InputType<Types> | ||
]; | ||
export declare type ObjectParam<Types extends SchemaTypes> = Extract<OutputType<Types>, keyof Types["Objects"]> | ObjectRef<unknown> | (new (...args: any[]) => any); | ||
export declare type InterfaceParam<Types extends SchemaTypes> = Extract<OutputType<Types>, keyof Types["Interfaces"]> | InterfaceRef<unknown> | (new (...args: any[]) => unknown); | ||
export interface BaseEnum { | ||
@@ -64,21 +68,33 @@ [s: string]: number | string; | ||
export declare type EnumParam = BaseEnum | string; | ||
export declare type ShapeWithNullability<Types extends SchemaTypes, Shape, Nullable extends boolean> = boolean extends Nullable ? Types['DefaultFieldNullability'] extends true ? Shape | null | undefined : Shape : Nullable extends true ? Shape | null | undefined : Shape; | ||
export declare type ShapeFromTypeParam<Types extends SchemaTypes, Param extends TypeParam<Types>, Nullable extends FieldNullability<Param>> = Param extends [OutputType<Types>] ? ShapeFromListTypeParam<Types, Param, Nullable> : FieldNullability<Param> extends Nullable ? Types['DefaultFieldNullability'] extends true ? OutputShape<Types, Param> | null | undefined : OutputShape<Types, Param> : Nullable extends true ? OutputShape<Types, Param> | null | undefined : OutputShape<Types, Param>; | ||
export declare type ShapeFromListTypeParam<Types extends SchemaTypes, Param extends [OutputType<Types>], Nullable extends FieldNullability<Param>> = FieldNullability<Param> extends Nullable ? Types['DefaultFieldNullability'] extends true ? OutputShape<Types, Param[0]>[] | null | undefined : OutputShape<Types, Param[0]>[] : Nullable extends true ? OutputShape<Types, Param[0]>[] | null | undefined : Nullable extends false ? OutputShape<Types, Param[0]>[] : Nullable extends { | ||
export declare type ShapeWithNullability<Types extends SchemaTypes, Shape, Nullable extends boolean> = boolean extends Nullable ? Types["DefaultFieldNullability"] extends true ? Shape | null | undefined : Shape : Nullable extends true ? Shape | null | undefined : Shape; | ||
export declare type ShapeFromTypeParam<Types extends SchemaTypes, Param extends TypeParam<Types>, Nullable extends FieldNullability<Param>> = Param extends [ | ||
OutputType<Types> | ||
] ? ShapeFromListTypeParam<Types, Param, Nullable> : FieldNullability<Param> extends Nullable ? Types["DefaultFieldNullability"] extends true ? OutputShape<Types, Param> | null | undefined : OutputShape<Types, Param> : Nullable extends true ? OutputShape<Types, Param> | null | undefined : OutputShape<Types, Param>; | ||
export declare type ShapeFromListTypeParam<Types extends SchemaTypes, Param extends [ | ||
OutputType<Types> | ||
], Nullable extends FieldNullability<Param>> = FieldNullability<Param> extends Nullable ? Types["DefaultFieldNullability"] extends true ? OutputShape<Types, Param[0]>[] | null | undefined : OutputShape<Types, Param[0]>[] : Nullable extends true ? OutputShape<Types, Param[0]>[] | null | undefined : Nullable extends false ? OutputShape<Types, Param[0]>[] : Nullable extends { | ||
list: infer List; | ||
items: infer Items; | ||
} ? Items extends boolean ? List extends true ? ShapeFromTypeParam<Types, Param[0], Items extends false ? false : true>[] | null | undefined : ShapeFromTypeParam<Types, Param[0], Items extends false ? false : true>[] : never : never; | ||
export declare type FieldNullability<Param> = boolean | (Param extends [unknown] ? boolean | { | ||
export declare type FieldNullability<Param> = boolean | (Param extends [ | ||
unknown | ||
] ? boolean | { | ||
items: boolean; | ||
list: boolean; | ||
} : boolean); | ||
export declare type InputShapeFromTypeParam<Types extends SchemaTypes, Param extends InputTypeParam<Types>, Required extends FieldRequiredness<Param>> = Param extends [InputType<Types>] ? InputShapeFromListTypeParam<Types, Param, Required> : FieldRequiredness<Param> extends Required ? Types['DefaultInputFieldRequiredness'] extends false ? InputShape<Types, Param> | null | undefined : InputShape<Types, Param> : Required extends true ? InputShape<Types, Param> : InputShape<Types, Param> | null | undefined; | ||
export declare type InputShapeFromListTypeParam<Types extends SchemaTypes, Param extends [InputType<Types>], Required extends FieldRequiredness<Param>> = FieldRequiredness<Param> extends Required ? Types['DefaultInputFieldRequiredness'] extends false ? InputShape<Types, Param[0]>[] | null | undefined : InputShape<Types, Param[0]>[] : Required extends true ? InputShape<Types, Param[0]>[] : Required extends false ? InputShape<Types, Param[0]>[] | null | undefined : FieldRequiredness<Param> extends Required ? InputShape<Types, Param[0]>[] | null | undefined : Required extends boolean | { | ||
export declare type InputShapeFromTypeParam<Types extends SchemaTypes, Param extends InputTypeParam<Types>, Required extends FieldRequiredness<Param>> = Param extends [ | ||
InputType<Types> | ||
] ? InputShapeFromListTypeParam<Types, Param, Required> : FieldRequiredness<Param> extends Required ? Types["DefaultInputFieldRequiredness"] extends false ? InputShape<Types, Param> | null | undefined : InputShape<Types, Param> : Required extends true ? InputShape<Types, Param> : InputShape<Types, Param> | null | undefined; | ||
export declare type InputShapeFromListTypeParam<Types extends SchemaTypes, Param extends [ | ||
InputType<Types> | ||
], Required extends FieldRequiredness<Param>> = FieldRequiredness<Param> extends Required ? Types["DefaultInputFieldRequiredness"] extends false ? InputShape<Types, Param[0]>[] | null | undefined : InputShape<Types, Param[0]>[] : Required extends true ? InputShape<Types, Param[0]>[] : Required extends false ? InputShape<Types, Param[0]>[] | null | undefined : FieldRequiredness<Param> extends Required ? InputShape<Types, Param[0]>[] | null | undefined : Required extends boolean | { | ||
list: infer List; | ||
items: infer Items; | ||
} ? Items extends boolean ? List extends true ? InputShapeFromTypeParam<Types, Param[0], Items extends false ? false : true>[] : InputShapeFromTypeParam<Types, Param[0], Items extends false ? false : true>[] | null | undefined : never : never; | ||
export declare type FieldRequiredness<Param> = boolean | (Param extends [unknown] ? boolean | { | ||
export declare type FieldRequiredness<Param> = boolean | (Param extends [ | ||
unknown | ||
] ? boolean | { | ||
items: boolean; | ||
list: boolean; | ||
} : boolean); | ||
//# sourceMappingURL=type-params.d.ts.map | ||
//# sourceMappingURL=type-params.d.ts.map |
@@ -44,3 +44,7 @@ export declare type MaybePromise<T> = Promise<T> | T; | ||
export declare type RemoveNeverKeys<T extends {}> = { | ||
[K in keyof T as [T[K]] extends [never] ? never : K]: T[K]; | ||
[K in keyof T as [ | ||
T[K] | ||
] extends [ | ||
never | ||
] ? never : K]: T[K]; | ||
}; | ||
@@ -55,3 +59,6 @@ export declare type Merge<T> = { | ||
} | ||
export declare type LastIndex<T extends unknown[]> = T extends [unknown, ...infer U] ? U['length'] : 0; | ||
export declare type LastIndex<T extends unknown[]> = T extends [ | ||
unknown, | ||
...infer U | ||
] ? U["length"] : 0; | ||
export declare type NormalizeArgs<T extends unknown[], Index extends keyof T = LastIndex<T>> = undefined extends T[Index] ? {} extends T[Index] ? T : { | ||
@@ -64,3 +71,3 @@ [K in keyof T]-?: T[K]; | ||
t: 1; | ||
}['t'] ? false : true; | ||
//# sourceMappingURL=utils.d.ts.map | ||
}["t"] ? false : true; | ||
//# sourceMappingURL=utils.d.ts.map |
export declare function encodeBase64(value: string): string; | ||
export declare function decodeBase64(value: string): string; | ||
//# sourceMappingURL=base64.d.ts.map | ||
//# sourceMappingURL=base64.d.ts.map |
@@ -6,3 +6,4 @@ export declare const contextCacheSymbol: unique symbol; | ||
export declare type ContextCache<T, C extends object, Args extends unknown[]> = (context: C, ...args: Args) => T; | ||
export declare function createContextCache<T, C extends object = object, Args extends unknown[] = []>(create: (context: C, ...args: Args) => T): ContextCache<T, C, Args>; | ||
//# sourceMappingURL=context-cache.d.ts.map | ||
export declare function createContextCache<T, C extends object = object, Args extends unknown[] = [ | ||
]>(create: (context: C, ...args: Args) => T): ContextCache<T, C, Args>; | ||
//# sourceMappingURL=context-cache.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import { BaseEnum, EnumValues, PothosEnumValueConfig, SchemaTypes } from '../types'; | ||
import { BaseEnum, EnumValues, PothosEnumValueConfig, SchemaTypes } from '../types/index.js'; | ||
export declare function normalizeEnumValues<Types extends SchemaTypes>(values: EnumValues<SchemaTypes>): Record<string, PothosEnumValueConfig<Types>>; | ||
export declare function valuesFromEnum<Types extends SchemaTypes>(Enum: BaseEnum): Record<string, PothosEnumValueConfig<Types>>; | ||
//# sourceMappingURL=enums.d.ts.map | ||
//# sourceMappingURL=enums.d.ts.map |
@@ -1,8 +0,8 @@ | ||
import { OutputType, SchemaTypes } from '../types'; | ||
export * from './base64'; | ||
export * from './context-cache'; | ||
export * from './enums'; | ||
export * from './input'; | ||
export * from './params'; | ||
export * from './sort-classes'; | ||
import { OutputType, SchemaTypes } from '../types/index.js'; | ||
export * from './base64.js'; | ||
export * from './context-cache.js'; | ||
export * from './enums.js'; | ||
export * from './input.js'; | ||
export * from './params.js'; | ||
export * from './sort-classes.js'; | ||
export declare function assertNever(value: never): never; | ||
@@ -15,2 +15,2 @@ export declare function assertArray(value: unknown): value is unknown[]; | ||
export declare function getTypeBrand(val: unknown): import("../types").BaseEnum | (new (...args: any[]) => any) | "String" | "ID" | "Int" | "Float" | "Boolean" | null; | ||
//# sourceMappingURL=index.d.ts.map | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import type BuildCache from '../build-cache'; | ||
import { PothosInputFieldConfig, PothosInputFieldType, PothosTypeConfig, SchemaTypes } from '../types'; | ||
import type BuildCache from '../build-cache.js'; | ||
import { PothosInputFieldConfig, PothosInputFieldType, PothosTypeConfig, SchemaTypes } from '../types/index.js'; | ||
export interface InputTypeFieldsMapping<Types extends SchemaTypes, T> { | ||
@@ -8,3 +8,3 @@ configs: Record<string, PothosInputFieldConfig<Types>>; | ||
export declare type InputFieldMapping<Types extends SchemaTypes, T> = { | ||
kind: 'Enum'; | ||
kind: "Enum"; | ||
isList: boolean; | ||
@@ -14,3 +14,3 @@ config: PothosInputFieldConfig<Types>; | ||
} | { | ||
kind: 'InputObject'; | ||
kind: "InputObject"; | ||
config: PothosInputFieldConfig<Types>; | ||
@@ -21,3 +21,3 @@ isList: boolean; | ||
} | { | ||
kind: 'Scalar'; | ||
kind: "Scalar"; | ||
isList: boolean; | ||
@@ -29,6 +29,7 @@ config: PothosInputFieldConfig<Types>; | ||
export declare function resolveInputTypeConfig<Types extends SchemaTypes>(type: PothosInputFieldType<Types>, buildCache: BuildCache<Types>): Extract<PothosTypeConfig, { | ||
kind: 'Enum' | 'InputObject' | 'Scalar'; | ||
kind: "Enum" | "InputObject" | "Scalar"; | ||
}>; | ||
export declare function mapInputFields<Types extends SchemaTypes, T>(inputs: Record<string, PothosInputFieldConfig<Types>>, buildCache: BuildCache<Types>, mapper: (config: PothosInputFieldConfig<Types>) => T | null): InputFieldsMapping<Types, T> | null; | ||
export declare function createInputValueMapper<Types extends SchemaTypes, T, Args extends unknown[] = []>(argMap: InputFieldsMapping<Types, T>, mapValue: (val: unknown, mapping: InputFieldMapping<Types, T>, ...args: Args) => unknown): (obj: object, map?: InputFieldsMapping<Types, T>, ...args: Args) => Record<string, unknown>; | ||
//# sourceMappingURL=input.d.ts.map | ||
export declare function createInputValueMapper<Types extends SchemaTypes, T, Args extends unknown[] = [ | ||
]>(argMap: InputFieldsMapping<Types, T>, mapValue: (val: unknown, mapping: InputFieldMapping<Types, T>, ...args: Args) => unknown): (obj: object, map?: InputFieldsMapping<Types, T>, ...args: Args) => Record<string, unknown>; | ||
//# sourceMappingURL=input.d.ts.map |
@@ -1,7 +0,11 @@ | ||
import type ConfigStore from '../config-store'; | ||
import { FieldNullability, FieldRequiredness, InputType, InputTypeParam, OutputType, PothosInputFieldType, PothosNameInputFieldType, PothosNameOutputFieldType, PothosOutputFieldType, SchemaTypes, TypeParam } from '../types'; | ||
import type ConfigStore from '../config-store.js'; | ||
import { FieldNullability, FieldRequiredness, InputType, InputTypeParam, OutputType, PothosInputFieldType, PothosNameInputFieldType, PothosNameOutputFieldType, PothosOutputFieldType, SchemaTypes, TypeParam } from '../types/index.js'; | ||
export declare function typeFromNonListParam<Types extends SchemaTypes>(type: OutputType<Types>, configStore: ConfigStore<Types>, nullable: boolean): PothosNameOutputFieldType<Types>; | ||
export declare function typeFromParam<Types extends SchemaTypes>(param: TypeParam<Types>, configStore: ConfigStore<Types>, nullable: FieldNullability<[unknown]>): PothosOutputFieldType<Types>; | ||
export declare function typeFromParam<Types extends SchemaTypes>(param: TypeParam<Types>, configStore: ConfigStore<Types>, nullable: FieldNullability<[ | ||
unknown | ||
]>): PothosOutputFieldType<Types>; | ||
export declare function inputTypeFromNonListParam<Types extends SchemaTypes>(type: InputType<Types>, configStore: ConfigStore<Types>, required: boolean): PothosNameInputFieldType<Types>; | ||
export declare function inputTypeFromParam<Types extends SchemaTypes>(param: InputTypeParam<Types>, configStore: ConfigStore<Types>, required: FieldRequiredness<[unknown]>): PothosInputFieldType<Types>; | ||
//# sourceMappingURL=params.d.ts.map | ||
export declare function inputTypeFromParam<Types extends SchemaTypes>(param: InputTypeParam<Types>, configStore: ConfigStore<Types>, required: FieldRequiredness<[ | ||
unknown | ||
]>): PothosInputFieldType<Types>; | ||
//# sourceMappingURL=params.d.ts.map |
export declare function classDepth(obj: {}): number; | ||
export declare function sortClasses<T extends new (...args: any[]) => unknown>(classes: T[]): T[]; | ||
//# sourceMappingURL=sort-classes.d.ts.map | ||
//# sourceMappingURL=sort-classes.d.ts.map |
{ | ||
"name": "@pothos/core", | ||
"version": "3.22.3", | ||
"version": "3.22.4", | ||
"description": "Pothos (formerly GiraphQL) is a plugin based schema builder for creating code-first GraphQL schemas in typescript", | ||
@@ -41,3 +41,3 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"@pothos/test-utils": "1.4.1", | ||
"@pothos/test-utils": "1.4.2", | ||
"graphql": "16.6.0", | ||
@@ -56,4 +56,4 @@ "graphql-scalars": "^1.18.0", | ||
"esm:extensions": "TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts", | ||
"test": "pnpm vitest --run" | ||
"test": "pnpm vitest --run --segfault-retry=3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
995408
13779