UNPKG

@giraphql/plugin-errors

Version:

A GiraphQL plugin for adding typed errors into your schema

24 lines 1.15 kB
import { EmptyToOptional, FieldNullability, Normalize, SchemaTypes, TypeParam } from '@giraphql/core'; export interface ErrorsPluginOptions { defaultTypes?: (new (...args: any[]) => Error)[]; directResult?: boolean; } export declare type ErrorFieldOptions<Types extends SchemaTypes, Type extends TypeParam<Types>, Shape, Nullable extends FieldNullability<Type>> = EmptyToOptional<{ types?: (new (...args: any[]) => Error)[]; directResult?: Type extends unknown[] ? false : boolean; union: Normalize<Omit<GiraphQLSchemaTypes.UnionTypeOptions<Types>, 'resolveType' | 'types'> & { name?: string; }>; result: Normalize<Omit<GiraphQLSchemaTypes.ObjectTypeOptions<Types, Shape>, 'interfaces' | 'isTypeOf'> & { name?: string; }>; dataField: Normalize<Omit<GiraphQLSchemaTypes.ObjectFieldOptions<Types, Shape, Type, Type extends [unknown] ? { list: false; items: Nullable extends { items: boolean; } ? Nullable['items'] : true; } : false, {}, Shape>, 'args' | 'nullable' | 'resolve' | 'type'> & { name?: string; }>; }>; //# sourceMappingURL=types.d.ts.map