UNPKG

@pothos/core

Version:

Pothos (formerly GiraphQL) is a plugin based schema builder for creating code-first GraphQL schemas in typescript

68 lines 8.6 kB
import { SchemaBuilder as SchemaBuilderClass } from './builder'; import './types/global'; import type { AddVersionedDefaultsToBuilderOptions, FieldKind, InputTypeParam, NormalizeSchemeBuilderOptions, PothosInputFieldConfig, PothosOutputFieldConfig, PothosTypeConfig, RootName, SchemaTypes, TypeParam } from './types'; export * from './errors'; export * from './plugins'; export * from './types'; export * from './utils'; declare const SchemaBuilder: { registerPlugin: typeof SchemaBuilderClass.registerPlugin; allowPluginReRegistration: boolean; new <Types extends Partial<PothosSchemaTypes.UserSchemaTypes> = {}>(options: Types extends { Defaults: "v3"; } ? AddVersionedDefaultsToBuilderOptions<PothosSchemaTypes.ExtendDefaultTypes<Types>, "v3"> : NormalizeSchemeBuilderOptions<PothosSchemaTypes.ExtendDefaultTypes<Types>>): PothosSchemaTypes.SchemaBuilder<PothosSchemaTypes.ExtendDefaultTypes<Types>>; }; export default SchemaBuilder; export declare const FieldBuilder: new <Types extends SchemaTypes, ParentShape, Kind extends Exclude<FieldKind, RootName> = Exclude<FieldKind, RootName>>(builder: PothosSchemaTypes.SchemaBuilder<Types>, kind: FieldKind, graphqlKind: PothosSchemaTypes.PothosKindToGraphQLType[FieldKind]) => PothosSchemaTypes.FieldBuilder<Types, ParentShape, Kind>; export type RootFieldBuilder<Types extends SchemaTypes, ParentShape, Kind extends FieldKind = FieldKind> = PothosSchemaTypes.RootFieldBuilder<Types, ParentShape, Kind>; export declare const RootFieldBuilder: new <Types extends SchemaTypes, ParentShape, Kind extends FieldKind = FieldKind>(builder: PothosSchemaTypes.SchemaBuilder<Types>, kind: FieldKind, graphqlKind: PothosSchemaTypes.PothosKindToGraphQLType[FieldKind]) => PothosSchemaTypes.RootFieldBuilder<Types, ParentShape, Kind>; export type QueryFieldBuilder<Types extends SchemaTypes, ParentShape> = PothosSchemaTypes.QueryFieldBuilder<Types, ParentShape>; export declare const QueryFieldBuilder: new <Types extends SchemaTypes, ParentShape>(builder: PothosSchemaTypes.SchemaBuilder<Types>) => PothosSchemaTypes.QueryFieldBuilder<Types, ParentShape>; export type MutationFieldBuilder<Types extends SchemaTypes, ParentShape> = PothosSchemaTypes.MutationFieldBuilder<Types, ParentShape>; export declare const MutationFieldBuilder: new <Types extends SchemaTypes, ParentShape>(builder: PothosSchemaTypes.SchemaBuilder<Types>) => PothosSchemaTypes.MutationFieldBuilder<Types, ParentShape>; export type SubscriptionFieldBuilder<Types extends SchemaTypes, ParentShape> = PothosSchemaTypes.SubscriptionFieldBuilder<Types, ParentShape>; export declare const SubscriptionFieldBuilder: new <Types extends SchemaTypes, ParentShape>(builder: PothosSchemaTypes.SchemaBuilder<Types>) => PothosSchemaTypes.SubscriptionFieldBuilder<Types, ParentShape>; export type ObjectFieldBuilder<Types extends SchemaTypes, ParentShape> = PothosSchemaTypes.ObjectFieldBuilder<Types, ParentShape>; export declare const ObjectFieldBuilder: new <Types extends SchemaTypes, ParentShape>(builder: PothosSchemaTypes.SchemaBuilder<Types>) => PothosSchemaTypes.ObjectFieldBuilder<Types, ParentShape>; export type InterfaceFieldBuilder<Types extends SchemaTypes, ParentShape> = PothosSchemaTypes.InterfaceFieldBuilder<Types, ParentShape>; export declare const InterfaceFieldBuilder: new <Types extends SchemaTypes, ParentShape>(builder: PothosSchemaTypes.SchemaBuilder<Types>) => PothosSchemaTypes.InterfaceFieldBuilder<Types, ParentShape>; export 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 "Arg" | "InputObject" = "Arg" | "InputObject">(builder: PothosSchemaTypes.SchemaBuilder<Types>, kind: Kind) => PothosSchemaTypes.InputFieldBuilder<Types, Kind>; export type BaseTypeRef<Types extends SchemaTypes, T> = PothosSchemaTypes.BaseTypeRef<Types, T>; export declare const BaseTypeRef: new <Types extends SchemaTypes, T>(kind: "Enum" | "InputObject" | "Interface" | "Object" | "Scalar" | "Union", name: string) => PothosSchemaTypes.BaseTypeRef<Types, T>; export type EnumRef<Types extends SchemaTypes, T, P = T> = PothosSchemaTypes.EnumRef<Types, T, P>; export declare const EnumRef: new <Types extends SchemaTypes, T, P = T>(name: string) => PothosSchemaTypes.EnumRef<Types, T, P>; export type InputObjectRef<Types extends SchemaTypes, T> = PothosSchemaTypes.InputObjectRef<Types, T>; export declare const InputObjectRef: new <Types extends SchemaTypes, T>(name: string) => PothosSchemaTypes.InputObjectRef<Types, T>; export type ImplementableInputObjectRef<Types extends SchemaTypes, T extends object> = PothosSchemaTypes.ImplementableInputObjectRef<Types, T>; export declare const ImplementableInputObjectRef: new <Types extends SchemaTypes, T extends object>(builder: PothosSchemaTypes.SchemaBuilder<Types>, name: string) => PothosSchemaTypes.ImplementableInputObjectRef<Types, T>; export type InputListRef<Types extends SchemaTypes, T> = PothosSchemaTypes.InputListRef<Types, T>; export declare const InputListRef: new <Types extends SchemaTypes, T>(listType: InputTypeParam<Types>, required: boolean) => PothosSchemaTypes.InputListRef<Types, T>; export type InterfaceRef<Types extends SchemaTypes, T, P = T> = PothosSchemaTypes.InterfaceRef<Types, T, P>; export declare const InterfaceRef: new <Types extends SchemaTypes, T, P = T>(name: string) => PothosSchemaTypes.InterfaceRef<Types, T, P>; export type ImplementableInterfaceRef<Types extends SchemaTypes, T, P = T> = PothosSchemaTypes.ImplementableInterfaceRef<Types, T, P>; export declare const ImplementableInterfaceRef: new <Types extends SchemaTypes, T, P = T>(builder: PothosSchemaTypes.SchemaBuilder<Types>, name: string) => PothosSchemaTypes.ImplementableInterfaceRef<Types, T, P>; export type ObjectRef<Types extends SchemaTypes, T, P = T> = PothosSchemaTypes.ObjectRef<Types, T, P>; export declare const ObjectRef: new <Types extends SchemaTypes, T, P = T>(name: string) => PothosSchemaTypes.ObjectRef<Types, T, P>; export type ImplementableObjectRef<Types extends SchemaTypes, T, P = T> = PothosSchemaTypes.ImplementableObjectRef<Types, T, P>; export declare const ImplementableObjectRef: new <Types extends SchemaTypes, T, P = T>(builder: PothosSchemaTypes.SchemaBuilder<Types>, name: string) => PothosSchemaTypes.ImplementableObjectRef<Types, T, P>; export type ScalarRef<Types extends SchemaTypes, T, U, P = T> = PothosSchemaTypes.ScalarRef<Types, T, U, P>; export declare const ScalarRef: new <Types extends SchemaTypes, T, U, P = T>(name: string) => PothosSchemaTypes.ScalarRef<Types, T, U, P>; export type UnionRef<Types extends SchemaTypes, T, P = T> = PothosSchemaTypes.UnionRef<Types, T, P>; export declare const UnionRef: new <Types extends SchemaTypes, T, P = T>(name: string) => PothosSchemaTypes.UnionRef<Types, T, P>; export type ListRef<Types extends SchemaTypes, T, P = T> = PothosSchemaTypes.ListRef<Types, T, P>; export declare const ListRef: new <Types extends SchemaTypes, T, P = T>(listType: TypeParam<Types>, nullable: boolean) => PothosSchemaTypes.ListRef<Types, T, P>; export type FieldRef<Types extends SchemaTypes, T = unknown, Kind extends FieldKind = FieldKind> = PothosSchemaTypes.FieldRef<Types, T, Kind>; export declare const FieldRef: new <Types extends SchemaTypes, T = unknown, Kind extends FieldKind = FieldKind>(kind: Kind, initConfig: (name: string, typeConfig: PothosTypeConfig) => PothosOutputFieldConfig<Types>) => PothosSchemaTypes.FieldRef<Types, T, Kind>; export type InputFieldRef<Types extends SchemaTypes, T> = PothosSchemaTypes.InputFieldRef<Types, T>; export declare const InputFieldRef: new <Types extends SchemaTypes, T>(initConfig: (name: string, typeConfig: PothosTypeConfig) => PothosInputFieldConfig<Types>) => PothosSchemaTypes.InputFieldRef<Types, T>; export type ArgumentRef<Types extends SchemaTypes, T> = PothosSchemaTypes.ArgumentRef<Types, T>; export declare const ArgumentRef: new <Types extends SchemaTypes, T>(initConfig: (name: string, field: string, typeConfig: PothosTypeConfig) => PothosInputFieldConfig<Types>) => PothosSchemaTypes.ArgumentRef<Types, T>; export { BuildCache } from './build-cache'; export { BuiltinScalarRef } from './refs/builtin-scalar'; export { InputTypeRef } from './refs/input'; export { MutationRef } from './refs/mutation'; export { OutputTypeRef } from './refs/output'; export { QueryRef } from './refs/query'; export { SubscriptionRef } from './refs/subscription'; //# sourceMappingURL=index.d.ts.map