graphql-extensions
Advanced tools
Comparing version 0.1.0-beta.5 to 0.1.0-beta.6
import { GraphQLSchema, GraphQLField, GraphQLResolveInfo, ExecutionArgs } from 'graphql'; | ||
export declare type EndHandler = (err: Error | null) => void; | ||
export declare type EndHandler = (...errors: Array<Error>) => void; | ||
export declare class GraphQLExtension<TContext = any> { | ||
@@ -4,0 +4,0 @@ requestDidStart?(o: { |
@@ -58,3 +58,7 @@ "use strict"; | ||
}); | ||
return function (err) { | ||
return function () { | ||
var errors = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
errors[_i] = arguments[_i]; | ||
} | ||
// We run end handlers in reverse order of start handlers. That way, the | ||
@@ -64,3 +68,3 @@ // first handler in the stack "surrounds" the entire event's process | ||
endHandlers.reverse(); | ||
endHandlers.forEach(function (endHandler) { return endHandler(err); }); | ||
endHandlers.forEach(function (endHandler) { return endHandler.apply(void 0, errors); }); | ||
}; | ||
@@ -67,0 +71,0 @@ }; |
{ | ||
"name": "graphql-extensions", | ||
"version": "0.1.0-beta.5", | ||
"version": "0.1.0-beta.6", | ||
"description": "Add extensions to GraphQL servers", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -11,3 +11,3 @@ import { | ||
export type EndHandler = (err: Error | null) => void; | ||
export type EndHandler = (...errors: Array<Error>) => void; | ||
type StartHandler = () => EndHandler | void; | ||
@@ -106,3 +106,3 @@ // A StartHandlerInvoker is a function that, given a specific GraphQLExtension, | ||
}); | ||
return (err: Error | null) => { | ||
return (...errors: Array<Error>) => { | ||
// We run end handlers in reverse order of start handlers. That way, the | ||
@@ -112,3 +112,3 @@ // first handler in the stack "surrounds" the entire event's process | ||
endHandlers.reverse(); | ||
endHandlers.forEach(endHandler => endHandler(err)); | ||
endHandlers.forEach(endHandler => endHandler(...errors)); | ||
}; | ||
@@ -115,0 +115,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24362
482