apollo-server-plugin-error
Advanced tools
Comparing version 1.0.1 to 1.1.0
import { ApolloServerPlugin, GraphQLRequestListener } from 'apollo-server-plugin-base'; | ||
import { GraphQLRequestContext, WithRequired } from 'apollo-server-types'; | ||
import { GraphQLError } from 'graphql'; | ||
export declare class ApolloServerPluginError<T> implements ApolloServerPlugin<T> { | ||
protected errorHandler: (e: GraphQLError) => any; | ||
constructor(errorHandler: (e: GraphQLError) => any); | ||
protected errorHandler: (e: GraphQLError, requestContext: WithRequired<GraphQLRequestContext<T>, 'metrics' | 'source' | 'errors'>) => any; | ||
constructor(errorHandler: (e: GraphQLError, requestContext: WithRequired<GraphQLRequestContext<T>, 'metrics' | 'source' | 'errors'>) => any); | ||
requestDidStart(): GraphQLRequestListener<T>; | ||
} |
@@ -12,3 +12,3 @@ "use strict"; | ||
requestContext.errors.forEach(function (err) { | ||
_this.errorHandler(err); | ||
_this.errorHandler(err, requestContext); | ||
}); | ||
@@ -15,0 +15,0 @@ }, |
{ | ||
"name": "apollo-server-plugin-error", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "apollo-server plugin that handle errors", | ||
@@ -5,0 +5,0 @@ "main": "dist/plugin.js", |
import { ApolloServerPlugin, GraphQLRequestListener } from 'apollo-server-plugin-base'; | ||
import { GraphQLRequestContext, WithRequired } from 'apollo-server-types'; | ||
import { GraphQLError } from 'graphql'; | ||
@@ -6,3 +7,6 @@ | ||
constructor( | ||
protected errorHandler: (e: GraphQLError) => any, | ||
protected errorHandler: (e: GraphQLError, requestContext: WithRequired< | ||
GraphQLRequestContext<T>, | ||
'metrics' | 'source' | 'errors' | ||
>) => any, | ||
) {} | ||
@@ -14,3 +18,3 @@ | ||
requestContext.errors.forEach(err => { | ||
this.errorHandler(err); | ||
this.errorHandler(err, requestContext); | ||
}); | ||
@@ -17,0 +21,0 @@ }, |
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
4574
72