@accounts/graphql-client
Advanced tools
Comparing version 0.3.0-beta.20 to 0.3.0-beta.21
@@ -196,11 +196,20 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var tokens, data, e_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.client.refreshSession()]; | ||
var tokens, _a, data, e_1; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
if (!(mutation === refresh_tokens_mutation_1.refreshTokensMutation)) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, this.client.getTokens()]; | ||
case 1: | ||
tokens = (_a.sent()) || { accessToken: '' }; | ||
_a.label = 2; | ||
case 2: | ||
_a.trys.push([2, 4, , 5]); | ||
_a = _b.sent(); | ||
return [3 /*break*/, 4]; | ||
case 2: return [4 /*yield*/, this.client.refreshSession()]; | ||
case 3: | ||
_a = _b.sent(); | ||
_b.label = 4; | ||
case 4: | ||
tokens = _a; | ||
_b.label = 5; | ||
case 5: | ||
_b.trys.push([5, 7, , 8]); | ||
return [4 /*yield*/, this.options.graphQLClient.mutate({ | ||
@@ -211,13 +220,13 @@ mutation: mutation, | ||
headers: { | ||
'accounts-access-token': tokens.accessToken, | ||
'accounts-access-token': tokens ? tokens.accessToken : '', | ||
}, | ||
}, | ||
})]; | ||
case 3: | ||
data = (_a.sent()).data; | ||
case 6: | ||
data = (_b.sent()).data; | ||
return [2 /*return*/, data[resultField]]; | ||
case 4: | ||
e_1 = _a.sent(); | ||
case 7: | ||
e_1 = _b.sent(); | ||
throw new Error(e_1.message); | ||
case 5: return [2 /*return*/]; | ||
case 8: return [2 /*return*/]; | ||
} | ||
@@ -224,0 +233,0 @@ }); |
{ | ||
"name": "@accounts/graphql-client", | ||
"version": "0.3.0-beta.20", | ||
"version": "0.3.0-beta.21", | ||
"description": "GraphQL client transport for accounts", | ||
@@ -38,7 +38,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@accounts/client": "^0.3.0-beta.20", | ||
"@accounts/common": "0.1.0-alpha.58382c10", | ||
"@accounts/types": "^0.3.0-beta.20", | ||
"@accounts/client": "^0.3.0-beta.21", | ||
"@accounts/types": "^0.3.0-beta.21", | ||
"graphql-tag": "^1.1.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
36365
3
500
- Removed@accounts/common@0.1.0-alpha.58382c10(transitive)
- Removedlodash@4.17.21(transitive)