Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/pothos/packages/core/fieldUtils/root.ts>RootFieldBuilder

Pothos GraphQL is library for creating GraphQL schemas in typescript using a strongly typed code first approach
Latest
class RootFieldBuilder
extends BaseFieldUtil<Types, ParentShape, Kind>
import { RootFieldBuilder } from "https://deno.land/x/pothos@release-1730496474/packages/core/fieldUtils/root.ts";

Type Parameters

Types extends SchemaTypes
ParentShape
optional
Kind extends FieldKind = FieldKind

Properties

arg: ArgBuilder<Types>

Methods

boolean<ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<"Boolean"> = Types["DefaultFieldNullability"], Args extends InputFieldMap = { }>(...args: NormalizeArgs<[Omit<FieldOptionsFromKind<Types, ParentShape, "Boolean", Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type">]>)

Create a Boolean field

booleanList<ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<["Boolean"]> = Types["DefaultFieldNullability"], Args extends InputFieldMap = { }>(...args: NormalizeArgs<[Omit<FieldOptionsFromKind<Types, ParentShape, ["Boolean"], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type">]>)

Create a Boolean list field

field<Type extends TypeParam<Types>, ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<Type> = Types["DefaultFieldNullability"], Args extends InputFieldMap = { }>(options: FieldOptionsFromKind<Types, ParentShape, Type, Nullable, Args, Kind, ResolveShape, ResolveReturnShape>)

create a new field for the current type

float<Nullable extends FieldNullability<"Float">, ResolveShape, ResolveReturnShape, Args extends InputFieldMap = { }>(...args: NormalizeArgs<[Omit<FieldOptionsFromKind<Types, ParentShape, "Float", Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type">]>)

Create a Float field

floatList<ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<["Float"]> = Types["DefaultFieldNullability"], Args extends InputFieldMap = { }>(...args: NormalizeArgs<[Omit<FieldOptionsFromKind<Types, ParentShape, ["Float"], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type">]>)

Create a Float list field

id<Nullable extends FieldNullability<"ID">, ResolveShape, ResolveReturnShape, Args extends InputFieldMap = { }>(...args: NormalizeArgs<[Omit<FieldOptionsFromKind<Types, ParentShape, "ID", Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type">]>)

Create a ID field

idList<Nullable extends FieldNullability<["ID"]>, ResolveShape, ResolveReturnShape, Args extends InputFieldMap = { }>(...args: NormalizeArgs<[Omit<FieldOptionsFromKind<Types, ParentShape, ["ID"], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type">]>)

Create a ID list field

int<Nullable extends FieldNullability<"Int">, ResolveShape, ResolveReturnShape, Args extends InputFieldMap = { }>(...args: NormalizeArgs<[Omit<FieldOptionsFromKind<Types, ParentShape, "Int", Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type">]>)

Create a Int field

intList<ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<["Int"]> = Types["DefaultFieldNullability"], Args extends InputFieldMap = { }>(...args: NormalizeArgs<[Omit<FieldOptionsFromKind<Types, ParentShape, ["Int"], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type">]>)

Create a Int list field

listRef<T extends TypeParam<Types>, Nullable extends boolean = false>(type: T, options?: { nullable?: Nullable; }): ListRef<Types, ShapeFromTypeParam<Types, T, Nullable>[]>
string<ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<"String"> = Types["DefaultFieldNullability"], Args extends InputFieldMap = { }>(...args: NormalizeArgs<[Omit<FieldOptionsFromKind<Types, ParentShape, "String", Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type">]>)

Create a String field

stringList<ResolveShape, ResolveReturnShape, Nullable extends FieldNullability<["String"]> = Types["DefaultFieldNullability"], Args extends InputFieldMap = { }>(...args: NormalizeArgs<[Omit<FieldOptionsFromKind<Types, ParentShape, ["String"], Nullable, Args, Kind, ResolveShape, ResolveReturnShape>, "type">]>)

Create a String list field