UNPKG

@apollo/core-schema

Version:
25 lines 899 B
import { ASTNode, GraphQLError, Source } from 'graphql'; import { Maybe } from 'graphql/jsutils/Maybe'; export declare type Props = { message: string; nodes?: Maybe<ReadonlyArray<ASTNode> | ASTNode>; source?: Maybe<Source>; positions?: Maybe<ReadonlyArray<number>>; path?: Maybe<ReadonlyArray<string | number>>; originalError?: Maybe<Error>; extensions?: Maybe<{ [key: string]: any; }>; causes?: Error[]; }; export declare class GraphQLErrorExt<C extends string> extends GraphQLError { readonly code: C; static readonly BASE_PROPS: Set<string>; readonly name: string; constructor(code: C, message: string, props?: Props); throw(): never; toString(): string; } export declare function err<C extends string, P extends Props>(code: C, props: P | string): GraphQLErrorExt<C> & P; export default err; //# sourceMappingURL=error.d.ts.map