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

apollo-link-retry

Package Overview
Dependencies
Maintainers
3
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-link-retry - npm Package Compare versions

Comparing version 2.0.0 to 2.1.1

2

lib/bundle.umd.js

@@ -30,3 +30,3 @@ (function (global, factory) {

return false;
return retryIf ? retryIf(error) : !!error;
return retryIf ? retryIf(error, operation) : !!error;
};

@@ -33,0 +33,0 @@ }

@@ -7,4 +7,4 @@ import { Operation } from 'apollo-link';

max?: number;
retryIf?: (error: any) => boolean;
retryIf?: (error: any, operation: Operation) => boolean;
}
export declare function buildRetryFunction({max, retryIf}?: RetryFunctionOptions): RetryFunction;

@@ -6,5 +6,5 @@ export function buildRetryFunction(_a) {

return false;
return retryIf ? retryIf(error) : !!error;
return retryIf ? retryIf(error, operation) : !!error;
};
}
//# sourceMappingURL=retryFunction.js.map
{
"name": "apollo-link-retry",
"version": "2.0.0",
"version": "2.1.1",
"description": "Retry Apollo Link for GraphQL Network Stack",

@@ -45,3 +45,3 @@ "author": "Evans Hauser <evanshauser@gmail.com>",

"@types/zen-observable": "0.5.3",
"apollo-link": "^1.0.6"
"apollo-link": "^1.0.7"
},

@@ -52,11 +52,11 @@ "devDependencies": {

"browserify": "14.5.0",
"graphql": "0.11.7",
"graphql-tag": "2.5.0",
"graphql": "0.12.3",
"graphql-tag": "2.6.0",
"jest": "21.2.1",
"rimraf": "2.6.1",
"rollup": "0.52.1",
"rollup": "0.52.2",
"ts-jest": "21.2.4",
"tslint": "5.8.0",
"typescript": "2.6.2",
"uglify-js": "3.2.1",
"uglify-js": "3.2.2",
"wait-for-observables": "1.0.3"

@@ -63,0 +63,0 @@ },

@@ -50,3 +50,3 @@ ---

max: 5,
retryIf: (_count, _operation, error) => !!error,
retryIf: (error, _operation) => !!error,
},

@@ -53,0 +53,0 @@ });

import { buildRetryFunction, RetryFunction } from '../retryFunction';
import { Operation } from 'apollo-link';

@@ -26,2 +27,12 @@ describe('buildRetryFunction', () => {

});
it('passes the error and operation through to custom predicates', () => {
const stub = jest.fn(() => true);
const retryFunction = buildRetryFunction({ max: 3, retryIf: stub });
const operation = { operationName: 'foo' } as Operation;
const error = { message: 'bewm' };
retryFunction(1, operation, error);
expect(stub).toHaveBeenCalledWith(error, operation);
});
});

@@ -30,3 +30,3 @@ import { Operation } from 'apollo-link';

*/
retryIf?: (error: any) => boolean;
retryIf?: (error: any, operation: Operation) => boolean;
}

@@ -39,4 +39,4 @@

if (count >= max) return false;
return retryIf ? retryIf(error) : !!error;
return retryIf ? retryIf(error, operation) : !!error;
};
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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