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

apollo-link-retry

Package Overview
Dependencies
Maintainers
2
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 0.0.1 to 0.1.0

3

dist/src/retryLink.d.ts

@@ -1,3 +0,2 @@

/// <reference types="zen-observable" />
import { ApolloLink, Observable, Operation, NextLink, FetchResult } from 'apollo-link';
import { ApolloLink, Observable, Operation, NextLink, FetchResult } from 'apollo-link-core';
export default class RetryLink extends ApolloLink {

@@ -4,0 +3,0 @@ private count;

@@ -13,3 +13,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var apollo_link_1 = require("apollo-link");
var apollo_link_core_1 = require("apollo-link-core");
var RetryLink = (function (_super) {

@@ -28,3 +28,3 @@ __extends(RetryLink, _super);

var _this = this;
return new apollo_link_1.Observable(function (observer) {
return new apollo_link_core_1.Observable(function (observer) {
var subscriber = {

@@ -59,4 +59,4 @@ next: function (data) {

return RetryLink;
}(apollo_link_1.ApolloLink));
}(apollo_link_core_1.ApolloLink));
exports.default = RetryLink;
//# sourceMappingURL=retryLink.js.map

@@ -6,3 +6,3 @@ "use strict";

var graphql_tag_1 = require("graphql-tag");
var apollo_link_1 = require("apollo-link");
var apollo_link_core_1 = require("apollo-link-core");
var retryLink_1 = require("../src/retryLink");

@@ -17,6 +17,6 @@ var query = (_a = ["\n {\n sample {\n id\n }\n }\n"], _a.raw = ["\n {\n sample {\n id\n }\n }\n"], graphql_tag_1.default(_a));

var stub = sinon.stub().callsFake(function () {
return new apollo_link_1.Observable(function (observer) { return observer.error(error); });
return new apollo_link_core_1.Observable(function (observer) { return observer.error(error); });
});
var link = apollo_link_1.ApolloLink.from([retry, stub]);
apollo_link_1.execute(link, { query: query }).subscribe(chai_1.expect.fail, function (actualError) {
var link = apollo_link_core_1.ApolloLink.from([retry, stub]);
apollo_link_core_1.execute(link, { query: query }).subscribe(chai_1.expect.fail, function (actualError) {
chai_1.assert.deepEqual(stub.callCount, max);

@@ -35,5 +35,5 @@ chai_1.assert.deepEqual(error, actualError);

var stub = sinon.stub();
stub.returns(apollo_link_1.Observable.of(data));
var link = apollo_link_1.ApolloLink.from([retry, stub]);
apollo_link_1.execute(link, { query: query }).subscribe(function (actualData) {
stub.returns(apollo_link_core_1.Observable.of(data));
var link = apollo_link_core_1.ApolloLink.from([retry, stub]);
apollo_link_core_1.execute(link, { query: query }).subscribe(function (actualData) {
chai_1.assert(stub.calledOnce);

@@ -54,6 +54,6 @@ chai_1.assert.deepEqual(data, actualData);

.onFirstCall()
.returns(new apollo_link_1.Observable(function (observer) { return observer.error(error); }));
stub.onSecondCall().returns(apollo_link_1.Observable.of(data));
var link = apollo_link_1.ApolloLink.from([retry, stub]);
apollo_link_1.execute(link, { query: query }).subscribe(function (actualData) {
.returns(new apollo_link_core_1.Observable(function (observer) { return observer.error(error); }));
stub.onSecondCall().returns(apollo_link_core_1.Observable.of(data));
var link = apollo_link_core_1.ApolloLink.from([retry, stub]);
apollo_link_core_1.execute(link, { query: query }).subscribe(function (actualData) {
chai_1.assert.deepEqual(stub.callCount, 2);

@@ -60,0 +60,0 @@ chai_1.assert.deepEqual(data, actualData);

@@ -1,3 +0,2 @@

/// <reference types="zen-observable" />
import { ApolloLink, Observable, Operation, NextLink, FetchResult } from 'apollo-link';
import { ApolloLink, Observable, Operation, NextLink, FetchResult } from 'apollo-link-core';
export default class RetryLink extends ApolloLink {

@@ -4,0 +3,0 @@ private count;

@@ -13,3 +13,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var apollo_link_1 = require("apollo-link");
var apollo_link_core_1 = require("apollo-link-core");
var RetryLink = (function (_super) {

@@ -28,3 +28,3 @@ __extends(RetryLink, _super);

var _this = this;
return new apollo_link_1.Observable(function (observer) {
return new apollo_link_core_1.Observable(function (observer) {
var subscriber = {

@@ -59,4 +59,4 @@ next: function (data) {

return RetryLink;
}(apollo_link_1.ApolloLink));
}(apollo_link_core_1.ApolloLink));
exports.default = RetryLink;
//# sourceMappingURL=retryLink.js.map
{
"name": "apollo-link-retry",
"version": "0.0.1",
"version": "0.1.0",
"description": "HTTP transport layer for GraphQL",

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

"dependencies": {
"apollo-link": "^0.0.3"
"apollo-link-core": "^0.1.0"
},

@@ -45,0 +45,0 @@ "devDependencies": {

@@ -7,3 +7,3 @@ import {

FetchResult,
} from 'apollo-link';
} from 'apollo-link-core';

@@ -10,0 +10,0 @@ export default class RetryLink extends ApolloLink {

import { assert, expect } from 'chai';
import * as sinon from 'sinon';
import gql from 'graphql-tag';
import { execute, ApolloLink, Observable, FetchResult } from 'apollo-link';
import { execute, ApolloLink, Observable, FetchResult } from 'apollo-link-core';

@@ -6,0 +6,0 @@ import RetryLink from '../src/retryLink';

Sorry, the diff of this file is not supported yet

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