Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apollo-server-plugin-error

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-server-plugin-error - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

5

dist/plugin.d.ts
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>;
}

2

dist/plugin.js

@@ -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 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc