apollo-link-retry
Advanced tools
Comparing version 0.0.1 to 0.1.0
@@ -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
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
24100
471
+ Addedapollo-link-core@^0.1.0
+ Addedapollo-link-core@0.1.1(transitive)
- Removedapollo-link@^0.0.3
- Removedapollo-fetch@0.3.0(transitive)
- Removedapollo-link@0.0.3(transitive)
- Removedencoding@0.1.13(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisomorphic-fetch@2.2.1(transitive)
- Removednode-fetch@1.7.3(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedwhatwg-fetch@3.6.20(transitive)