graphql-yoga
Version:
<div align="center"><img src="./website/public/cover.png" width="720" /></div>
27 lines (26 loc) • 1.13 kB
TypeScript
import { GraphQLError } from 'graphql';
import { createGraphQLError } from '@graphql-tools/utils';
import type { YogaLogger } from './logger.js';
import type { ResultProcessorInput } from './plugins/types.js';
import type { YogaMaskedErrorOpts } from './types.js';
export { createGraphQLError };
declare module 'graphql' {
interface GraphQLHTTPErrorExtensions {
spec?: boolean;
status?: number;
headers?: Record<string, string>;
}
interface GraphQLErrorExtensions {
http?: GraphQLHTTPErrorExtensions;
unexpected?: boolean;
}
}
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, logger: YogaLogger): GraphQLError[];
export declare function getResponseInitByRespectingErrors(result: ResultProcessorInput, headers?: Record<string, string>, isApplicationJson?: boolean): {
status: number;
headers: Record<string, string>;
};