UNPKG

@pothos/plugin-errors

Version:

A Pothos plugin for adding typed errors into your schema

25 lines 2.16 kB
import './global-types'; import { BasePlugin, type Normalize, type PothosOutputFieldConfig, type PothosOutputFieldType, type SchemaTypes, type TypeParam } from '@pothos/core'; import type { GraphQLFieldResolver, GraphQLIsTypeOfFn } from 'graphql'; import type { ErrorFieldOptions, GetTypeName } from './types'; export * from './types'; declare const pluginName = "errors"; export default pluginName; export declare function capitalize(s: string): string; export declare const defaultGetResultName: GetTypeName; export declare const defaultGetListItemResultName: GetTypeName; export declare const defaultGetUnionName: GetTypeName; export declare const defaultGetListItemUnionName: GetTypeName; export declare const unwrapError: unique symbol; export declare class PothosErrorsPlugin<Types extends SchemaTypes> extends BasePlugin<Types> { wrapIsTypeOf(isTypeOf: GraphQLIsTypeOfFn<unknown, Types['Context']> | undefined): GraphQLIsTypeOfFn<unknown, Types['Context']> | undefined; onOutputFieldConfig(fieldConfig: PothosOutputFieldConfig<Types>): PothosOutputFieldConfig<Types> | null; wrapResolve(resolver: GraphQLFieldResolver<unknown, Types['Context'], object>, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types['Context'], object>; wrapSubscribe(subscribe: GraphQLFieldResolver<unknown, Types['Context'], object>, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types['Context'], object> | undefined; createResultType(parentTypeName: string, fieldName: string, type: TypeParam<Types>, fieldType: PothosOutputFieldType<Types>, errorOptions: ErrorFieldOptions<Types, TypeParam<Types>, unknown, false>, directResultError: string, defaultResultName: GetTypeName, defaultUnionName: GetTypeName, builderResultOptions?: Normalize<Omit<PothosSchemaTypes.ObjectTypeOptions<Types, {}>, 'interfaces' | 'isTypeOf'> & { name?: GetTypeName; }>, builderUnionOptions?: Normalize<Omit<PothosSchemaTypes.UnionTypeOptions<Types>, 'resolveType' | 'types'> & { name?: GetTypeName; }>): PothosSchemaTypes.UnionRef<Types, unknown, unknown>; } //# sourceMappingURL=index.d.ts.map