@pothos/core
Version:
Pothos (formerly GiraphQL) is a plugin based schema builder for creating code-first GraphQL schemas in typescript
63 lines (62 loc) • 6.86 kB
TypeScript
import './types/global/index.js';
import { SchemaBuilder as SchemaBuilderClass } from './builder.js';
import type { AddVersionedDefaultsToBuilderOptions, FieldKind, InputTypeParam, NormalizeSchemeBuilderOptions, RootName, SchemaTypes, TypeParam } from './types/index.js';
export * from './errors.js';
export * from './plugins/index.js';
export * from './types/index.js';
export * from './utils/index.js';
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 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 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 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 { BuildCache } from './build-cache.js';
export { ArgumentRef } from './refs/arg.js';
export { BuiltinScalarRef } from './refs/builtin-scalar.js';
export { FieldRef } from './refs/field.js';
export { InputTypeRef } from './refs/input.js';
export { InputFieldRef } from './refs/input-field.js';
export { ImplementableInputObjectRef } from './refs/input-object.js';
export { ImplementableInterfaceRef } from './refs/interface.js';
export { MutationRef } from './refs/mutation.js';
export { ImplementableObjectRef } from './refs/object.js';
export { OutputTypeRef } from './refs/output.js';
export { QueryRef } from './refs/query.js';
export { SubscriptionRef } from './refs/subscription.js';
//# sourceMappingURL=index.d.ts.map