@pothos/core
Advanced tools
Comparing version 3.20.0 to 3.21.0
# Change Log | ||
## 3.21.0 | ||
### Minor Changes | ||
- cf93c7c9: Allow nullable arguments to set null as a default value | ||
- cf93c7c9: Fix some edge cases with how option objects become optional when no arguments are | ||
required | ||
## 3.20.0 | ||
@@ -4,0 +12,0 @@ |
@@ -23,17 +23,17 @@ import { GraphQLScalarSerializer, GraphQLScalarType, GraphQLSchema } from 'graphql'; | ||
queryType(...args: NormalizeArgs<[ | ||
options?: PothosSchemaTypes.QueryTypeOptions<Types>, | ||
options: PothosSchemaTypes.QueryTypeOptions<Types>, | ||
fields?: QueryFieldsShape<Types> | ||
]>): void; | ||
], 0>): void; | ||
queryFields(fields: QueryFieldsShape<Types>): void; | ||
queryField(name: string, field: QueryFieldThunk<Types>): void; | ||
mutationType(...args: NormalizeArgs<[ | ||
options?: PothosSchemaTypes.MutationTypeOptions<Types>, | ||
options: PothosSchemaTypes.MutationTypeOptions<Types>, | ||
fields?: MutationFieldsShape<Types> | ||
]>): void; | ||
], 0>): void; | ||
mutationFields(fields: MutationFieldsShape<Types>): void; | ||
mutationField(name: string, field: MutationFieldThunk<Types>): void; | ||
subscriptionType(...args: NormalizeArgs<[ | ||
options?: PothosSchemaTypes.SubscriptionTypeOptions<Types>, | ||
options: PothosSchemaTypes.SubscriptionTypeOptions<Types>, | ||
fields?: SubscriptionFieldsShape<Types> | ||
]>): void; | ||
], 0>): void; | ||
subscriptionFields(fields: SubscriptionFieldsShape<Types>): void; | ||
@@ -40,0 +40,0 @@ subscriptionField(name: string, field: SubscriptionFieldThunk<Types>): void; |
@@ -9,5 +9,4 @@ import { CompatibleTypes, FieldKind, FieldNullability, FieldOptionsFromKind, NormalizeArgs, SchemaTypes, TypeParam } from '../types'; | ||
*/ | ||
exposeBoolean<Name extends CompatibleTypes<Types, ParentShape, 'Boolean', Nullable>, ResolveReturnShape, Nullable extends FieldNullability<'Boolean'> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
name: Name, | ||
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>; | ||
@@ -19,5 +18,4 @@ /** | ||
*/ | ||
exposeFloat<Name extends CompatibleTypes<Types, ParentShape, 'Float', Nullable>, ResolveReturnShape, Nullable extends FieldNullability<'Float'> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
name: Name, | ||
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>; | ||
@@ -29,5 +27,4 @@ /** | ||
*/ | ||
exposeID<Name extends CompatibleTypes<Types, ParentShape, 'ID', Nullable>, ResolveReturnShape, Nullable extends FieldNullability<'ID'> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
name: Name, | ||
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>; | ||
@@ -39,5 +36,4 @@ /** | ||
*/ | ||
exposeInt<Name extends CompatibleTypes<Types, ParentShape, 'Int', Nullable>, ResolveReturnShape, Nullable extends FieldNullability<'Int'> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
name: Name, | ||
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>; | ||
@@ -49,5 +45,4 @@ /** | ||
*/ | ||
exposeString<Name extends CompatibleTypes<Types, ParentShape, 'String', Nullable>, ResolveReturnShape, Nullable extends FieldNullability<'String'> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
name: Name, | ||
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>; | ||
@@ -59,5 +54,4 @@ /** | ||
*/ | ||
exposeBooleanList<Name extends CompatibleTypes<Types, ParentShape, ['Boolean'], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<['Boolean']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
name: Name, | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
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' | ||
@@ -71,5 +65,4 @@ ], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
*/ | ||
exposeFloatList<Name extends CompatibleTypes<Types, ParentShape, ['Float'], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<['Float']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
name: Name, | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
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' | ||
@@ -83,5 +76,4 @@ ], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
*/ | ||
exposeIDList<Name extends CompatibleTypes<Types, ParentShape, ['ID'], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<['ID']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
name: Name, | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
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' | ||
@@ -95,5 +87,4 @@ ], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
*/ | ||
exposeIntList<Name extends CompatibleTypes<Types, ParentShape, ['Int'], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<['Int']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
name: Name, | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
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' | ||
@@ -107,5 +98,4 @@ ], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
*/ | ||
exposeStringList<Name extends CompatibleTypes<Types, ParentShape, ['String'], Nullable>, ResolveReturnShape, Nullable extends FieldNullability<['String']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
name: Name, | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
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' | ||
@@ -119,7 +109,6 @@ ], Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> | ||
*/ | ||
expose<Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, ResolveReturnShape, Name extends CompatibleTypes<Types, ParentShape, Type, Nullable>>(...args: NormalizeArgs<[ | ||
name: Name, | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, Type, Nullable, {}, Kind, ParentShape, ResolveReturnShape>, 'resolve'> | ||
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'> | ||
]>): import("..").FieldRef<import("../types").ShapeFromTypeParam<Types, Type, Nullable>, Kind>; | ||
} | ||
//# sourceMappingURL=builder.d.ts.map |
@@ -12,3 +12,3 @@ import InputFieldRef from '../refs/input-field'; | ||
*/ | ||
boolean: <Req extends FieldRequiredness<"Boolean">>(...args: NormalizeArgs<[options?: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "Boolean", Req>[Kind], "type"> | undefined]>) => 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 +18,3 @@ * Create a Float input field | ||
*/ | ||
float: <Req extends FieldRequiredness<"Float">>(...args: NormalizeArgs<[options?: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "Float", Req>[Kind], "type"> | undefined]>) => 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 +24,3 @@ * Create a ID input field | ||
*/ | ||
id: <Req extends FieldRequiredness<"ID">>(...args: NormalizeArgs<[options?: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "ID", Req>[Kind], "type"> | undefined]>) => 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 +30,3 @@ * Create a Int input field | ||
*/ | ||
int: <Req extends FieldRequiredness<"Int">>(...args: NormalizeArgs<[options?: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "Int", Req>[Kind], "type"> | undefined]>) => 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 +36,3 @@ * Create a String input field | ||
*/ | ||
string: <Req extends FieldRequiredness<"String">>(...args: NormalizeArgs<[options?: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "String", Req>[Kind], "type"> | undefined]>) => 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 +42,3 @@ * Create a Boolean list input field | ||
*/ | ||
booleanList: <Req extends FieldRequiredness<["Boolean"]>>(...args: NormalizeArgs<[options?: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, ["Boolean"], Req>[Kind], "type"> | undefined]>) => 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 +48,3 @@ * Create a Float list input field | ||
*/ | ||
floatList: <Req extends FieldRequiredness<["Float"]>>(...args: NormalizeArgs<[options?: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, ["Float"], Req>[Kind], "type"> | undefined]>) => 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 +54,3 @@ * Create a ID list input field | ||
*/ | ||
idList: <Req extends FieldRequiredness<["ID"]>>(...args: NormalizeArgs<[options?: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, ["ID"], Req>[Kind], "type"> | undefined]>) => 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 +60,3 @@ * Create a Int list input field | ||
*/ | ||
intList: <Req extends FieldRequiredness<["Int"]>>(...args: NormalizeArgs<[options?: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, ["Int"], Req>[Kind], "type"> | undefined]>) => 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 +66,3 @@ * Create a String list input field | ||
*/ | ||
stringList: <Req extends FieldRequiredness<["String"]>>(...args: NormalizeArgs<[options?: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, ["String"], Req>[Kind], "type"> | undefined]>) => 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); | ||
@@ -69,0 +69,0 @@ argBuilder(): ArgBuilder<Types>; |
@@ -11,3 +11,3 @@ import type { ArgBuilder, InputFieldMap, NormalizeArgs } from '../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'> | ||
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>; | ||
@@ -19,3 +19,3 @@ /** | ||
float<Args extends InputFieldMap, Nullable extends FieldNullability<'Float'>, ResolveShape, ResolveReturnShape>(...args: NormalizeArgs<[ | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, 'Float', Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
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>; | ||
@@ -27,3 +27,3 @@ /** | ||
id<Args extends InputFieldMap, Nullable extends FieldNullability<'ID'>, ResolveShape, ResolveReturnShape>(...args: NormalizeArgs<[ | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, 'ID', Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
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>; | ||
@@ -35,3 +35,3 @@ /** | ||
int<Args extends InputFieldMap, Nullable extends FieldNullability<'Int'>, ResolveShape, ResolveReturnShape>(...args: NormalizeArgs<[ | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, 'Int', Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
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>; | ||
@@ -43,3 +43,3 @@ /** | ||
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'> | ||
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>; | ||
@@ -51,3 +51,3 @@ /** | ||
booleanList<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<['Boolean']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'Boolean' | ||
@@ -61,3 +61,3 @@ ], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
floatList<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<['Float']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'Float' | ||
@@ -71,3 +71,3 @@ ], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
idList<Args extends InputFieldMap, Nullable extends FieldNullability<['ID']>, ResolveShape, ResolveReturnShape>(...args: NormalizeArgs<[ | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'ID' | ||
@@ -81,3 +81,3 @@ ], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
intList<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<['Int']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'Int' | ||
@@ -91,3 +91,3 @@ ], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> | ||
stringList<Args extends InputFieldMap, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<['String']> = Types['DefaultFieldNullability']>(...args: NormalizeArgs<[ | ||
options?: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
options: Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'String' | ||
@@ -94,0 +94,0 @@ ], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, 'type'> |
@@ -101,6 +101,6 @@ import type { GraphQLFieldExtensions } from 'graphql'; | ||
deprecationReason?: string; | ||
/** etermins if this field can be omitted (or set as null) */ | ||
/** determines if this field can be omitted (or set as null) */ | ||
required?: Req; | ||
/** default value if this field is not included in the query */ | ||
defaultValue?: NonNullable<InputShapeFromTypeParam<Types, Type, Req>>; | ||
defaultValue?: InputShapeFromTypeParam<Types, Type, Req>; | ||
/** extensions for this field for use by directives, server plugins or other tools that depend on extensions */ | ||
@@ -107,0 +107,0 @@ extensions?: Readonly<Record<string, unknown>>; |
@@ -55,4 +55,6 @@ export declare type MaybePromise<T> = Promise<T> | T; | ||
export declare type LastIndex<T extends unknown[]> = T extends [unknown, ...infer U] ? U['length'] : 0; | ||
export declare type NormalizeArgs<T extends unknown[]> = undefined extends T[LastIndex<T>] ? {} extends T[LastIndex<T>] ? T : { | ||
[K in keyof T]-?: NonNullable<T[K]>; | ||
export declare type NormalizeArgs<T extends unknown[], Index extends keyof T = LastIndex<T>> = undefined extends T[Index] ? {} extends T[Index] ? T : { | ||
[K in keyof T]-?: T[K]; | ||
} : {} extends T[Index] ? { | ||
[K in keyof T]?: T[K]; | ||
} : T; | ||
@@ -59,0 +61,0 @@ export declare type IsStrictMode = undefined extends { |
@@ -7,4 +7,4 @@ import RootFieldBuilder from './root.js'; | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeBoolean(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeBoolean(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -19,4 +19,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeFloat(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeFloat(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -31,4 +31,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeID(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeID(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -43,4 +43,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeInt(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeInt(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -55,4 +55,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeString(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeString(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -67,4 +67,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeBooleanList(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeBooleanList(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -81,4 +81,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeFloatList(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeFloatList(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -95,4 +95,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeIDList(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeIDList(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -109,4 +109,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeIntList(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeIntList(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -123,4 +123,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeStringList(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeStringList(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -137,4 +137,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ expose(...args) { | ||
const [name, options = {}] = args; | ||
*/ expose(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, options); | ||
@@ -141,0 +141,0 @@ } |
@@ -20,4 +20,4 @@ "use strict"; | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeBoolean(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeBoolean(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -32,4 +32,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeFloat(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeFloat(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -44,4 +44,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeID(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeID(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -56,4 +56,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeInt(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeInt(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -68,4 +68,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeString(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeString(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -80,4 +80,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeBooleanList(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeBooleanList(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -94,4 +94,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeFloatList(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeFloatList(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -108,4 +108,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeIDList(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeIDList(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -122,4 +122,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeIntList(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeIntList(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -136,4 +136,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ exposeStringList(...args) { | ||
const [name, options = {}] = args; | ||
*/ exposeStringList(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, { | ||
@@ -150,4 +150,4 @@ ...options, | ||
* @param {object} [options={}] - Options for this field | ||
*/ expose(...args) { | ||
const [name, options = {}] = args; | ||
*/ expose(name, ...args) { | ||
const [options = {}] = args; | ||
return this.exposeField(name, options); | ||
@@ -154,0 +154,0 @@ } |
{ | ||
"name": "@pothos/core", | ||
"version": "3.20.0", | ||
"version": "3.21.0", | ||
"description": "Pothos (formerly GiraphQL) is a plugin based schema builder for creating code-first GraphQL schemas in typescript", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -205,3 +205,4 @@ import { | ||
...args: NormalizeArgs< | ||
[options?: PothosSchemaTypes.QueryTypeOptions<Types>, fields?: QueryFieldsShape<Types>] | ||
[options: PothosSchemaTypes.QueryTypeOptions<Types>, fields?: QueryFieldsShape<Types>], | ||
0 | ||
> | ||
@@ -242,3 +243,4 @@ ) { | ||
...args: NormalizeArgs< | ||
[options?: PothosSchemaTypes.MutationTypeOptions<Types>, fields?: MutationFieldsShape<Types>] | ||
[options: PothosSchemaTypes.MutationTypeOptions<Types>, fields?: MutationFieldsShape<Types>], | ||
0 | ||
> | ||
@@ -280,5 +282,6 @@ ) { | ||
[ | ||
options?: PothosSchemaTypes.SubscriptionTypeOptions<Types>, | ||
options: PothosSchemaTypes.SubscriptionTypeOptions<Types>, | ||
fields?: SubscriptionFieldsShape<Types>, | ||
] | ||
], | ||
0 | ||
> | ||
@@ -285,0 +288,0 @@ ) { |
@@ -27,6 +27,6 @@ import { | ||
>( | ||
name: Name, | ||
...args: NormalizeArgs< | ||
[ | ||
name: Name, | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -47,3 +47,3 @@ Types, | ||
) { | ||
const [name, options = {} as never] = args; | ||
const [options = {} as never] = args; | ||
@@ -63,6 +63,6 @@ return this.exposeField<'Boolean', Nullable, Name>(name, { ...options, type: 'Boolean' }); | ||
>( | ||
name: Name, | ||
...args: NormalizeArgs< | ||
[ | ||
name: Name, | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -83,3 +83,3 @@ Types, | ||
) { | ||
const [name, options = {} as never] = args; | ||
const [options = {} as never] = args; | ||
@@ -99,6 +99,6 @@ return this.exposeField<'Float', Nullable, Name>(name, { ...options, type: 'Float' }); | ||
>( | ||
name: Name, | ||
...args: NormalizeArgs< | ||
[ | ||
name: Name, | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -119,3 +119,3 @@ Types, | ||
) { | ||
const [name, options = {} as never] = args; | ||
const [options = {} as never] = args; | ||
@@ -135,6 +135,6 @@ return this.exposeField<'ID', Nullable, Name>(name, { ...options, type: 'ID' }); | ||
>( | ||
name: Name, | ||
...args: NormalizeArgs< | ||
[ | ||
name: Name, | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -155,3 +155,3 @@ Types, | ||
) { | ||
const [name, options = {} as never] = args; | ||
const [options = {} as never] = args; | ||
@@ -171,6 +171,6 @@ return this.exposeField<'Int', Nullable, Name>(name, { ...options, type: 'Int' }); | ||
>( | ||
name: Name, | ||
...args: NormalizeArgs< | ||
[ | ||
name: Name, | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -191,3 +191,3 @@ Types, | ||
) { | ||
const [name, options = {} as never] = args; | ||
const [options = {} as never] = args; | ||
@@ -207,6 +207,6 @@ return this.exposeField<'String', Nullable, Name>(name, { ...options, type: 'String' }); | ||
>( | ||
name: Name, | ||
...args: NormalizeArgs< | ||
[ | ||
name: Name, | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -227,3 +227,3 @@ Types, | ||
) { | ||
const [name, options = {} as never] = args; | ||
const [options = {} as never] = args; | ||
@@ -243,6 +243,6 @@ return this.exposeField<['Boolean'], Nullable, Name>(name, { ...options, type: ['Boolean'] }); | ||
>( | ||
name: Name, | ||
...args: NormalizeArgs< | ||
[ | ||
name: Name, | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -263,3 +263,3 @@ Types, | ||
) { | ||
const [name, options = {} as never] = args; | ||
const [options = {} as never] = args; | ||
@@ -279,6 +279,6 @@ return this.exposeField<['Float'], Nullable, Name>(name, { ...options, type: ['Float'] }); | ||
>( | ||
name: Name, | ||
...args: NormalizeArgs< | ||
[ | ||
name: Name, | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -299,3 +299,3 @@ Types, | ||
) { | ||
const [name, options = {} as never] = args; | ||
const [options = {} as never] = args; | ||
@@ -315,6 +315,6 @@ return this.exposeField<['ID'], Nullable, Name>(name, { ...options, type: ['ID'] }); | ||
>( | ||
name: Name, | ||
...args: NormalizeArgs< | ||
[ | ||
name: Name, | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -335,3 +335,3 @@ Types, | ||
) { | ||
const [name, options = {} as never] = args; | ||
const [options = {} as never] = args; | ||
@@ -351,6 +351,6 @@ return this.exposeField<['Int'], Nullable, Name>(name, { ...options, type: ['Int'] }); | ||
>( | ||
name: Name, | ||
...args: NormalizeArgs< | ||
[ | ||
name: Name, | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -371,3 +371,3 @@ Types, | ||
) { | ||
const [name, options = {} as never] = args; | ||
const [options = {} as never] = args; | ||
@@ -388,6 +388,6 @@ return this.exposeField<['String'], Nullable, Name>(name, { ...options, type: ['String'] }); | ||
>( | ||
name: Name, | ||
...args: NormalizeArgs< | ||
[ | ||
name: Name, | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -408,3 +408,3 @@ Types, | ||
) { | ||
const [name, options = {} as never] = args; | ||
const [options = {} as never] = args; | ||
@@ -411,0 +411,0 @@ return this.exposeField(name, options); |
@@ -147,3 +147,3 @@ import InputFieldRef from '../refs/input-field'; | ||
...args: NormalizeArgs< | ||
[options?: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, Type, Req>[Kind], 'type'>] | ||
[options: Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, Type, Req>[Kind], 'type'>] | ||
> | ||
@@ -150,0 +150,0 @@ ) => { |
@@ -35,3 +35,3 @@ import type { ArgBuilder, InputFieldMap, NormalizeArgs } from '../types'; | ||
[ | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -73,3 +73,3 @@ Types, | ||
[ | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -111,3 +111,3 @@ Types, | ||
[ | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -149,3 +149,3 @@ Types, | ||
[ | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -187,3 +187,3 @@ Types, | ||
[ | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -225,3 +225,3 @@ Types, | ||
[ | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -263,3 +263,3 @@ Types, | ||
[ | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -301,3 +301,3 @@ Types, | ||
[ | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -339,3 +339,3 @@ Types, | ||
[ | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -377,3 +377,3 @@ Types, | ||
[ | ||
options?: Omit< | ||
options: Omit< | ||
FieldOptionsFromKind< | ||
@@ -380,0 +380,0 @@ Types, |
@@ -268,6 +268,6 @@ import type { GraphQLFieldExtensions } from 'graphql'; | ||
deprecationReason?: string; | ||
/** etermins if this field can be omitted (or set as null) */ | ||
/** determines if this field can be omitted (or set as null) */ | ||
required?: Req; | ||
/** default value if this field is not included in the query */ | ||
defaultValue?: NonNullable<InputShapeFromTypeParam<Types, Type, Req>>; | ||
defaultValue?: InputShapeFromTypeParam<Types, Type, Req>; | ||
/** extensions for this field for use by directives, server plugins or other tools that depend on extensions */ | ||
@@ -274,0 +274,0 @@ extensions?: Readonly<Record<string, unknown>>; |
@@ -83,8 +83,13 @@ export type MaybePromise<T> = Promise<T> | T; | ||
export type LastIndex<T extends unknown[]> = T extends [unknown, ...infer U] ? U['length'] : 0; | ||
export type NormalizeArgs<T extends unknown[]> = undefined extends T[LastIndex<T>] | ||
? {} extends T[LastIndex<T>] | ||
export type NormalizeArgs< | ||
T extends unknown[], | ||
Index extends keyof T = LastIndex<T>, | ||
> = undefined extends T[Index] | ||
? {} extends T[Index] | ||
? T | ||
: { [K in keyof T]-?: NonNullable<T[K]> } | ||
: { [K in keyof T]-?: T[K] } | ||
: {} extends T[Index] | ||
? { [K in keyof T]?: T[K] } | ||
: T; | ||
export type IsStrictMode = undefined extends { t: 1 }['t'] ? false : true; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
867829
12018