UNPKG

graphql-yoga

Version:
22 lines (21 loc) 883 B
import { GraphQLError } from 'graphql'; import type { ResultProcessorInput } from './plugins/types'; import type { YogaMaskedErrorOpts } from './types'; 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>; };