diff --git a/types/graphql-errors/graphql-errors-tests.ts b/types/graphql-errors/graphql-errors-tests.ts index 0820fe2afa..d9d07b2071 100644 --- a/types/graphql-errors/graphql-errors-tests.ts +++ b/types/graphql-errors/graphql-errors-tests.ts @@ -2,7 +2,7 @@ import { GraphQLSchema, buildSchema } from 'graphql'; import { UserError, maskErrors, - handlerFunction, + HandlerFunction, setDefaultHandler } from 'graphql-errors'; @@ -11,7 +11,7 @@ const schema: GraphQLSchema = buildSchema(` # graphql schema definition `); -const customHandler: handlerFunction = err => { +const customHandler: HandlerFunction = err => { return { ...err, message: 'Internal error' }; }; diff --git a/types/graphql-errors/index.d.ts b/types/graphql-errors/index.d.ts index 5dc452ab20..d179cf3d7e 100644 --- a/types/graphql-errors/index.d.ts +++ b/types/graphql-errors/index.d.ts @@ -6,11 +6,11 @@ import { GraphQLSchema } from 'graphql'; -export type handlerFunction = (err: Error) => Error; +export type HandlerFunction = (err: Error) => Error; -export function setDefaultHandler(fn: handlerFunction): void; +export function setDefaultHandler(fn: HandlerFunction): void; -export function maskErrors(schema: GraphQLSchema, fn?: handlerFunction): void; +export function maskErrors(schema: GraphQLSchema, fn?: HandlerFunction): void; export class UserError extends Error { constructor(message: string);