UNPKG

graphql-yoga

Version:
24 lines (23 loc) 973 B
import { createGraphQLError } from '@graphql-tools/utils'; import { GraphQLError } from 'graphql'; import type { ResultProcessorInput } from './plugins/types'; import type { YogaMaskedErrorOpts } from './types'; export { createGraphQLError }; declare module 'graphql' { interface GraphQLHTTPErrorExtensions { status?: number; headers?: Record<string, string>; } interface GraphQLErrorExtensions { http?: GraphQLHTTPErrorExtensions; } } export declare function isGraphQLError(val: unknown): val is GraphQLError; export declare function isOriginalGraphQLError(val: unknown): val is GraphQLError & { originalError: GraphQLError; }; export declare function handleError(error: unknown, maskedErrorsOpts: YogaMaskedErrorOpts | null): GraphQLError[]; export declare function getResponseInitByRespectingErrors(result: ResultProcessorInput, headers?: Record<string, string>): { status: number; headers: Record<string, string>; };