@apollo/gateway 2.1.0-alpha.0 → 2.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/datasources/RemoteGraphQLDataSource.d.ts.map +1 -1
- package/dist/datasources/RemoteGraphQLDataSource.js +2 -3
- package/dist/datasources/RemoteGraphQLDataSource.js.map +1 -1
- package/dist/datasources/types.d.ts +1 -0
- package/dist/datasources/types.d.ts.map +1 -1
- package/dist/executeQueryPlan.d.ts +2 -2
- package/dist/executeQueryPlan.d.ts.map +1 -1
- package/dist/executeQueryPlan.js +24 -16
- package/dist/executeQueryPlan.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -18
- package/dist/index.js.map +1 -1
- package/dist/operationContext.d.ts.map +1 -1
- package/dist/operationContext.js +3 -7
- package/dist/operationContext.js.map +1 -1
- package/dist/supergraphManagers/IntrospectAndCompose/index.d.ts +1 -1
- package/dist/supergraphManagers/IntrospectAndCompose/index.d.ts.map +1 -1
- package/dist/supergraphManagers/IntrospectAndCompose/loadServicesFromRemoteEndpoint.d.ts +1 -1
- package/dist/supergraphManagers/IntrospectAndCompose/loadServicesFromRemoteEndpoint.d.ts.map +1 -1
- package/dist/supergraphManagers/IntrospectAndCompose/loadServicesFromRemoteEndpoint.js.map +1 -1
- package/dist/supergraphManagers/UplinkSupergraphManager/index.d.ts +7 -7
- package/dist/supergraphManagers/UplinkSupergraphManager/index.d.ts.map +1 -1
- package/dist/supergraphManagers/UplinkSupergraphManager/index.js +38 -42
- package/dist/supergraphManagers/UplinkSupergraphManager/index.js.map +1 -1
- package/dist/supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.d.ts +9 -8
- package/dist/supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.d.ts.map +1 -1
- package/dist/supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.js +19 -10
- package/dist/supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.js.map +1 -1
- package/dist/supergraphManagers/UplinkSupergraphManager/outOfBandReporter.d.ts +2 -1
- package/dist/supergraphManagers/UplinkSupergraphManager/outOfBandReporter.d.ts.map +1 -1
- package/dist/supergraphManagers/UplinkSupergraphManager/outOfBandReporter.js.map +1 -1
- package/dist/supergraphManagers/UplinkSupergraphManager/types.d.ts +9 -0
- package/dist/supergraphManagers/UplinkSupergraphManager/types.d.ts.map +1 -0
- package/dist/supergraphManagers/UplinkSupergraphManager/types.js +5 -0
- package/dist/supergraphManagers/UplinkSupergraphManager/types.js.map +1 -0
- package/package.json +7 -7
- package/src/__tests__/executeQueryPlan.test.ts +199 -1
- package/src/__tests__/execution-utils.ts +5 -3
- package/src/__tests__/integration/abstract-types.test.ts +31 -65
- package/src/__tests__/integration/configuration.test.ts +2 -2
- package/src/__tests__/integration/managed.test.ts +47 -44
- package/src/__tests__/integration/networkRequests.test.ts +10 -23
- package/src/config.ts +1 -1
- package/src/datasources/RemoteGraphQLDataSource.ts +1 -2
- package/src/datasources/types.ts +4 -0
- package/src/executeQueryPlan.ts +41 -30
- package/src/index.ts +8 -22
- package/src/operationContext.ts +5 -7
- package/src/supergraphManagers/IntrospectAndCompose/index.ts +1 -1
- package/src/supergraphManagers/IntrospectAndCompose/loadServicesFromRemoteEndpoint.ts +1 -1
- package/src/supergraphManagers/UplinkSupergraphManager/__tests__/UplinkSupergraphManager.test.ts +1 -3
- package/src/supergraphManagers/UplinkSupergraphManager/__tests__/loadSupergraphSdlFromStorage.test.ts +51 -16
- package/src/supergraphManagers/UplinkSupergraphManager/index.ts +64 -58
- package/src/supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.ts +31 -19
- package/src/supergraphManagers/UplinkSupergraphManager/outOfBandReporter.ts +2 -1
- package/src/supergraphManagers/UplinkSupergraphManager/types.ts +10 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadServicesFromRemoteEndpoint.js","sourceRoot":"","sources":["../../../src/supergraphManagers/IntrospectAndCompose/loadServicesFromRemoteEndpoint.ts"],"names":[],"mappings":";;;AACA,qCAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"loadServicesFromRemoteEndpoint.js","sourceRoot":"","sources":["../../../src/supergraphManagers/IntrospectAndCompose/loadServicesFromRemoteEndpoint.ts"],"names":[],"mappings":";;;AACA,qCAAgC;AAChC,2CAAuD;AAEvD,mDAA0F;AAC1F,6BAAiD;AAO1C,KAAK,UAAU,8BAA8B,CAAC,EACnD,WAAW,EACX,8BAA8B,EAC9B,eAAe,GAOhB;IACC,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;QACvC,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;KACH;IAED,IAAI,WAAW,GAAG,KAAK,CAAC;IAExB,MAAM,oBAAoB,GAAG,WAAW,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE;QAC/E,IAAI,CAAC,GAAG,EAAE;YACR,MAAM,IAAI,KAAK,CACb,6BAA6B,IAAI,+BAA+B,CAAC,CAAC;SACrE;QAED,MAAM,OAAO,GAAmB;YAC9B,KAAK,EAAE,4BAAwB;YAC/B,IAAI,EAAE;gBACJ,GAAG;gBACH,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,IAAI,oBAAO,CAAC,MAAM,8BAA8B,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;aAC1E;SACF,CAAC;QAEF,OAAO,UAAU;aACd,OAAO,CAAC;YACP,IAAI,EAAE,oCAA4B,CAAC,cAAc;YACjD,OAAO;YACP,OAAO,EAAE,EAAE;SACZ,CAAC;aACD,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAqB,EAAE;YAC5C,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;gBACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAa,CAAC;gBAC7C,MAAM,kBAAkB,GAAG,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAGrD,IAAI,kBAAkB,KAAK,QAAQ,EAAE;oBACnC,WAAW,GAAG,IAAI,CAAC;iBACpB;gBACD,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBACpC,OAAO;oBACL,IAAI;oBACJ,GAAG;oBACH,QAAQ,EAAE,IAAA,eAAK,EAAC,QAAQ,CAAC;iBAC1B,CAAC;aACH;YAED,MAAM,IAAI,KAAK,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,MAAM,YAAY,GAChB,0CAA0C,IAAI,QAAQ,GAAG,EAAE;gBAC3D,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAExD,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACnE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAAA;AAC5C,CAAC;AAtED,wEAsEC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Logger } from '@apollo/utils.logger';
|
|
2
2
|
import { SupergraphManager, SupergraphSdlHookOptions } from '../../config';
|
|
3
|
-
import { Fetcher } from '@apollo/utils.fetcher';
|
|
4
|
-
export declare const DEFAULT_UPLINK_ENDPOINTS: string[];
|
|
5
3
|
export declare type FailureToFetchSupergraphSdlFunctionParams = {
|
|
6
4
|
error: Error;
|
|
7
5
|
graphRef: string;
|
|
@@ -13,13 +11,17 @@ export declare type FailureToFetchSupergraphSdlAfterInit = ({ error, graphRef, l
|
|
|
13
11
|
mostRecentSuccessfulFetchAt?: Date;
|
|
14
12
|
}) => Promise<string | null>;
|
|
15
13
|
export declare class UplinkSupergraphManager implements SupergraphManager {
|
|
14
|
+
static readonly DEFAULT_REQUEST_TIMEOUT_MS = 30000;
|
|
15
|
+
static readonly MIN_POLL_INTERVAL_MS = 10000;
|
|
16
|
+
static readonly DEFAULT_UPLINK_ENDPOINTS: string[];
|
|
16
17
|
readonly uplinkEndpoints: string[];
|
|
17
18
|
private apiKey;
|
|
18
19
|
private graphRef;
|
|
19
20
|
private fetcher;
|
|
20
21
|
private maxRetries;
|
|
22
|
+
private requestTimeoutMs;
|
|
21
23
|
private initialMaxRetries;
|
|
22
|
-
private
|
|
24
|
+
private pollIntervalMs;
|
|
23
25
|
private logger;
|
|
24
26
|
private update?;
|
|
25
27
|
private shouldRunSubgraphHealthcheck;
|
|
@@ -31,15 +33,12 @@ export declare class UplinkSupergraphManager implements SupergraphManager {
|
|
|
31
33
|
private errorReportingEndpoint;
|
|
32
34
|
private compositionId?;
|
|
33
35
|
private fetchCount;
|
|
34
|
-
private minDelayMs;
|
|
35
|
-
private earliestFetchTime;
|
|
36
36
|
private mostRecentSuccessfulFetchAt?;
|
|
37
|
-
constructor({ apiKey, graphRef, debug, logger,
|
|
37
|
+
constructor({ apiKey, graphRef, debug, logger, uplinkEndpoints, fallbackPollIntervalInMs, maxRetries, initialMaxRetries, shouldRunSubgraphHealthcheck, onFailureToFetchSupergraphSdlDuringInit, onFailureToFetchSupergraphSdlAfterInit, }: {
|
|
38
38
|
apiKey: string;
|
|
39
39
|
graphRef: string;
|
|
40
40
|
debug?: boolean;
|
|
41
41
|
logger?: Logger;
|
|
42
|
-
fetcher?: Fetcher;
|
|
43
42
|
uplinkEndpoints?: string[];
|
|
44
43
|
fallbackPollIntervalInMs?: number;
|
|
45
44
|
maxRetries?: number;
|
|
@@ -53,6 +52,7 @@ export declare class UplinkSupergraphManager implements SupergraphManager {
|
|
|
53
52
|
cleanup: () => Promise<void>;
|
|
54
53
|
}>;
|
|
55
54
|
nextFetch(): Promise<void | null>;
|
|
55
|
+
static getUplinkEndpoints(): string[];
|
|
56
56
|
private updateSupergraphSdl;
|
|
57
57
|
private beginPolling;
|
|
58
58
|
private poll;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAS3E,oBAAY,yCAAyC,GAAG;IACtD,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,qCAAqC,GAAG,CAAC,EACnD,KAAK,EACL,QAAQ,EACR,MAAM,EACN,UAAU,GACX,EAAE,yCAAyC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEjE,oBAAY,oCAAoC,GAAG,CAAC,EAClD,KAAK,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EACV,2BAA2B,GAC5B,EACG,y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,EAAE,MAAM,EAAE,CAAC;QAC3B,wBAAwB,CAAC,EAAE,MAAM,CAAC;QAClC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,4BAA4B,CAAC,EAAE,OAAO,CAAC;QACvC,uCAAuC,CAAC,EAAE,qCAAqC,CAAC;QAChF,sCAAsC,CAAC,EAAE,oCAAoC,CAAC;KAC/E;IA8BY,UAAU,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,wBAAwB;;;;IA0C5D,SAAS,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;WAYhC,kBAAkB,IAAI,MAAM,EAAE;YAM9B,mBAAmB;IA2EjC,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,IAAI;IA+BZ,OAAO,CAAC,gBAAgB;CAMzB"}
|
|
@@ -26,41 +26,33 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.UplinkSupergraphManager =
|
|
29
|
+
exports.UplinkSupergraphManager = void 0;
|
|
30
30
|
const makeFetchHappen = __importStar(require("make-fetch-happen"));
|
|
31
31
|
const resolvable_1 = __importDefault(require("@josephg/resolvable"));
|
|
32
32
|
const logger_1 = require("../../logger");
|
|
33
33
|
const loadSupergraphSdlFromStorage_1 = require("./loadSupergraphSdlFromStorage");
|
|
34
|
-
exports.DEFAULT_UPLINK_ENDPOINTS = [
|
|
35
|
-
'https://uplink.api.apollographql.com/',
|
|
36
|
-
'https://aws.uplink.api.apollographql.com/',
|
|
37
|
-
];
|
|
38
|
-
function getUplinkEndpoints() {
|
|
39
|
-
var _a;
|
|
40
|
-
const envEndpoints = (_a = process.env.APOLLO_SCHEMA_CONFIG_DELIVERY_ENDPOINT) === null || _a === void 0 ? void 0 : _a.split(',');
|
|
41
|
-
return envEndpoints !== null && envEndpoints !== void 0 ? envEndpoints : exports.DEFAULT_UPLINK_ENDPOINTS;
|
|
42
|
-
}
|
|
43
34
|
class UplinkSupergraphManager {
|
|
44
|
-
constructor({ apiKey, graphRef, debug, logger,
|
|
35
|
+
constructor({ apiKey, graphRef, debug, logger, uplinkEndpoints, fallbackPollIntervalInMs, maxRetries, initialMaxRetries, shouldRunSubgraphHealthcheck, onFailureToFetchSupergraphSdlDuringInit, onFailureToFetchSupergraphSdlAfterInit, }) {
|
|
45
36
|
var _a;
|
|
46
|
-
this.uplinkEndpoints = getUplinkEndpoints();
|
|
37
|
+
this.uplinkEndpoints = UplinkSupergraphManager.getUplinkEndpoints();
|
|
47
38
|
this.fetcher = makeFetchHappen.defaults();
|
|
48
|
-
this.
|
|
39
|
+
this.requestTimeoutMs = UplinkSupergraphManager.DEFAULT_REQUEST_TIMEOUT_MS;
|
|
40
|
+
this.pollIntervalMs = UplinkSupergraphManager.MIN_POLL_INTERVAL_MS;
|
|
49
41
|
this.shouldRunSubgraphHealthcheck = false;
|
|
50
42
|
this.timerRef = null;
|
|
51
43
|
this.errorReportingEndpoint = (_a = process.env.APOLLO_OUT_OF_BAND_REPORTER_ENDPOINT) !== null && _a !== void 0 ? _a : undefined;
|
|
52
44
|
this.fetchCount = 0;
|
|
53
|
-
this.minDelayMs = null;
|
|
54
|
-
this.earliestFetchTime = null;
|
|
55
45
|
this.apiKey = apiKey;
|
|
56
46
|
this.graphRef = graphRef;
|
|
57
47
|
this.logger = logger !== null && logger !== void 0 ? logger : (0, logger_1.getDefaultLogger)(debug);
|
|
58
48
|
this.uplinkEndpoints = uplinkEndpoints !== null && uplinkEndpoints !== void 0 ? uplinkEndpoints : this.uplinkEndpoints;
|
|
59
49
|
this.maxRetries = maxRetries !== null && maxRetries !== void 0 ? maxRetries : this.uplinkEndpoints.length * 3 - 1;
|
|
60
50
|
this.initialMaxRetries = initialMaxRetries !== null && initialMaxRetries !== void 0 ? initialMaxRetries : this.maxRetries;
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
63
|
-
|
|
51
|
+
this.pollIntervalMs = fallbackPollIntervalInMs !== null && fallbackPollIntervalInMs !== void 0 ? fallbackPollIntervalInMs : this.pollIntervalMs;
|
|
52
|
+
if (this.pollIntervalMs < UplinkSupergraphManager.MIN_POLL_INTERVAL_MS) {
|
|
53
|
+
this.logger.warn('Polling Apollo services at a frequency of less than once per 10 seconds (10000) is disallowed. Instead, the minimum allowed pollInterval of 10000 will be used. Please reconfigure your `fallbackPollIntervalInMs` accordingly. If this is problematic for your team, please contact support.');
|
|
54
|
+
this.pollIntervalMs = UplinkSupergraphManager.MIN_POLL_INTERVAL_MS;
|
|
55
|
+
}
|
|
64
56
|
this.shouldRunSubgraphHealthcheck =
|
|
65
57
|
shouldRunSubgraphHealthcheck !== null && shouldRunSubgraphHealthcheck !== void 0 ? shouldRunSubgraphHealthcheck : this.shouldRunSubgraphHealthcheck;
|
|
66
58
|
this.onFailureToFetchSupergraphSdlDuringInit =
|
|
@@ -74,17 +66,12 @@ class UplinkSupergraphManager {
|
|
|
74
66
|
if (this.shouldRunSubgraphHealthcheck) {
|
|
75
67
|
this.healthCheck = healthCheck;
|
|
76
68
|
}
|
|
77
|
-
let initialSupergraphSdl =
|
|
69
|
+
let initialSupergraphSdl = null;
|
|
78
70
|
try {
|
|
79
|
-
|
|
80
|
-
if (!
|
|
71
|
+
initialSupergraphSdl = await this.updateSupergraphSdl(this.initialMaxRetries);
|
|
72
|
+
if (!initialSupergraphSdl) {
|
|
81
73
|
throw new Error('Invalid supergraph schema supplied during initialization.');
|
|
82
74
|
}
|
|
83
|
-
initialSupergraphSdl = result.supergraphSdl;
|
|
84
|
-
if (result.minDelaySeconds) {
|
|
85
|
-
this.minDelayMs = 1000 * result.minDelaySeconds;
|
|
86
|
-
this.earliestFetchTime = new Date(Date.now() + this.minDelayMs);
|
|
87
|
-
}
|
|
88
75
|
}
|
|
89
76
|
catch (e) {
|
|
90
77
|
this.logUpdateFailure(e);
|
|
@@ -112,10 +99,14 @@ class UplinkSupergraphManager {
|
|
|
112
99
|
}
|
|
113
100
|
return this.state.nextFetchPromise;
|
|
114
101
|
}
|
|
102
|
+
static getUplinkEndpoints() {
|
|
103
|
+
var _a;
|
|
104
|
+
const envEndpoints = (_a = process.env.APOLLO_SCHEMA_CONFIG_DELIVERY_ENDPOINT) === null || _a === void 0 ? void 0 : _a.split(',');
|
|
105
|
+
return envEndpoints !== null && envEndpoints !== void 0 ? envEndpoints : UplinkSupergraphManager.DEFAULT_UPLINK_ENDPOINTS;
|
|
106
|
+
}
|
|
115
107
|
async updateSupergraphSdl(maxRetries) {
|
|
116
108
|
var _a, _b;
|
|
117
109
|
let supergraphSdl;
|
|
118
|
-
let minDelaySeconds = this.fallbackPollIntervalMs / 1000;
|
|
119
110
|
try {
|
|
120
111
|
const result = await (0, loadSupergraphSdlFromStorage_1.loadSupergraphSdlFromUplinks)({
|
|
121
112
|
graphRef: this.graphRef,
|
|
@@ -125,16 +116,20 @@ class UplinkSupergraphManager {
|
|
|
125
116
|
fetcher: this.fetcher,
|
|
126
117
|
compositionId: (_a = this.compositionId) !== null && _a !== void 0 ? _a : null,
|
|
127
118
|
maxRetries,
|
|
119
|
+
requestTimeoutMs: this.requestTimeoutMs,
|
|
128
120
|
roundRobinSeed: this.fetchCount++,
|
|
129
|
-
earliestFetchTime: this.earliestFetchTime,
|
|
130
121
|
logger: this.logger,
|
|
131
122
|
});
|
|
123
|
+
this.mostRecentSuccessfulFetchAt = new Date();
|
|
124
|
+
this.logger.debug(`Received Uplink response. Has updated SDL? ${!!(result === null || result === void 0 ? void 0 : result.supergraphSdl)}`);
|
|
132
125
|
if (!result) {
|
|
133
126
|
return null;
|
|
134
127
|
}
|
|
135
128
|
this.compositionId = result.id;
|
|
136
|
-
|
|
137
|
-
|
|
129
|
+
supergraphSdl = result.supergraphSdl;
|
|
130
|
+
if (result === null || result === void 0 ? void 0 : result.minDelaySeconds) {
|
|
131
|
+
this.pollIntervalMs = result.minDelaySeconds * 1000;
|
|
132
|
+
}
|
|
138
133
|
}
|
|
139
134
|
catch (e) {
|
|
140
135
|
this.logger.debug(`Error fetching supergraphSdl from Uplink during phase '${this.state.phase}'`);
|
|
@@ -165,33 +160,28 @@ class UplinkSupergraphManager {
|
|
|
165
160
|
}
|
|
166
161
|
}
|
|
167
162
|
await ((_b = this.healthCheck) === null || _b === void 0 ? void 0 : _b.call(this, supergraphSdl));
|
|
168
|
-
return
|
|
163
|
+
return supergraphSdl;
|
|
169
164
|
}
|
|
170
165
|
beginPolling() {
|
|
171
166
|
this.state = { phase: 'polling' };
|
|
172
167
|
this.poll();
|
|
173
168
|
}
|
|
174
169
|
poll() {
|
|
175
|
-
const delay = this.minDelayMs
|
|
176
|
-
? Math.max(this.minDelayMs, this.fallbackPollIntervalMs)
|
|
177
|
-
: this.fallbackPollIntervalMs;
|
|
178
170
|
if (this.state.phase !== 'polling') {
|
|
171
|
+
this.logger.debug(`Stopped polling Uplink [phase: ${this.state.phase}]`);
|
|
179
172
|
return;
|
|
180
173
|
}
|
|
181
174
|
this.state.nextFetchPromise = (0, resolvable_1.default)();
|
|
175
|
+
this.logger.debug(`Will poll Uplink after ${this.pollIntervalMs}ms [phase: ${this.state.phase}]`);
|
|
182
176
|
this.timerRef = setTimeout(async () => {
|
|
183
177
|
var _a, _b;
|
|
184
178
|
if (this.state.phase === 'polling') {
|
|
185
179
|
const pollingPromise = (0, resolvable_1.default)();
|
|
186
180
|
this.state.pollingPromise = pollingPromise;
|
|
187
181
|
try {
|
|
188
|
-
const
|
|
189
|
-
if (
|
|
190
|
-
this.
|
|
191
|
-
this.earliestFetchTime = new Date(Date.now() + this.minDelayMs);
|
|
192
|
-
}
|
|
193
|
-
if (result === null || result === void 0 ? void 0 : result.supergraphSdl) {
|
|
194
|
-
(_a = this.update) === null || _a === void 0 ? void 0 : _a.call(this, result.supergraphSdl);
|
|
182
|
+
const supergraphSdl = await this.updateSupergraphSdl(this.maxRetries);
|
|
183
|
+
if (supergraphSdl) {
|
|
184
|
+
(_a = this.update) === null || _a === void 0 ? void 0 : _a.call(this, supergraphSdl);
|
|
195
185
|
}
|
|
196
186
|
}
|
|
197
187
|
catch (e) {
|
|
@@ -201,7 +191,7 @@ class UplinkSupergraphManager {
|
|
|
201
191
|
(_b = this.state.nextFetchPromise) === null || _b === void 0 ? void 0 : _b.resolve();
|
|
202
192
|
}
|
|
203
193
|
this.poll();
|
|
204
|
-
},
|
|
194
|
+
}, this.pollIntervalMs);
|
|
205
195
|
}
|
|
206
196
|
logUpdateFailure(e) {
|
|
207
197
|
var _a;
|
|
@@ -210,4 +200,10 @@ class UplinkSupergraphManager {
|
|
|
210
200
|
}
|
|
211
201
|
}
|
|
212
202
|
exports.UplinkSupergraphManager = UplinkSupergraphManager;
|
|
203
|
+
UplinkSupergraphManager.DEFAULT_REQUEST_TIMEOUT_MS = 30000;
|
|
204
|
+
UplinkSupergraphManager.MIN_POLL_INTERVAL_MS = 10000;
|
|
205
|
+
UplinkSupergraphManager.DEFAULT_UPLINK_ENDPOINTS = [
|
|
206
|
+
'https://uplink.api.apollographql.com/',
|
|
207
|
+
'https://aws.uplink.api.apollographql.com/',
|
|
208
|
+
];
|
|
213
209
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAqD;AAErD,qEAA6D;AAM7D,yCAAgD;AAChD,iFAA8E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAqD;AAErD,qEAA6D;AAM7D,yCAAgD;AAChD,iFAA8E;AAsC9E,MAAa,uBAAuB;IAiClC,YAAY,EACV,MAAM,EACN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AE,CAAC;aACxC;YAED,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC1B,CAAC;IAEO,gBAAgB,CAAC,CAAM;;QAC7B,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,gFAAgF;YAC9E,CAAC,MAAA,CAAC,CAAC,OAAO,mCAAI,CAAC,CAAC,CACnB,CAAC;IACJ,CAAC;;AAvQH,0DAwQC;AAvQwB,kDAA0B,GAAG,KAAM,CAAC;AACpC,4CAAoB,GAAG,KAAM,CAAC;AAE9B,gDAAwB,GAAG;IAChD,uCAAuC;IACvC,2CAA2C;CAC5C,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SupergraphSdlUpdate } from '../../config';
|
|
2
|
-
import type { Fetcher } from '@apollo/utils.fetcher';
|
|
3
2
|
import type { Logger } from '@apollo/utils.logger';
|
|
3
|
+
import type { AbortableFetcher as Fetcher } from './types';
|
|
4
4
|
export declare const SUPERGRAPH_SDL_QUERY = "#graphql\n query SupergraphSdl($apiKey: String!, $ref: String!, $ifAfterId: ID) {\n routerConfig(ref: $ref, apiKey: $apiKey, ifAfterId: $ifAfterId) {\n __typename\n ... on RouterConfigResult {\n id\n supergraphSdl: supergraphSDL\n minDelaySeconds\n }\n ... on FetchError {\n code\n message\n }\n }\n }\n";
|
|
5
5
|
export declare class UplinkFetcherError extends Error {
|
|
6
6
|
constructor(message: string);
|
|
7
7
|
}
|
|
8
|
-
export declare function loadSupergraphSdlFromUplinks({ graphRef, apiKey, endpoints, errorReportingEndpoint, fetcher, compositionId, maxRetries,
|
|
8
|
+
export declare function loadSupergraphSdlFromUplinks({ graphRef, apiKey, endpoints, errorReportingEndpoint, fetcher, compositionId, maxRetries, requestTimeoutMs, roundRobinSeed, logger, }: {
|
|
9
9
|
graphRef: string;
|
|
10
10
|
apiKey: string;
|
|
11
11
|
endpoints: string[];
|
|
@@ -13,17 +13,18 @@ export declare function loadSupergraphSdlFromUplinks({ graphRef, apiKey, endpoin
|
|
|
13
13
|
fetcher: Fetcher;
|
|
14
14
|
compositionId: string | null;
|
|
15
15
|
maxRetries: number;
|
|
16
|
+
requestTimeoutMs: number;
|
|
16
17
|
roundRobinSeed: number;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
export declare function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorReportingEndpoint, fetcher, compositionId, logger, }: {
|
|
18
|
+
logger: Logger;
|
|
19
|
+
}): Promise<SupergraphSdlUpdate | null>;
|
|
20
|
+
export declare function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorReportingEndpoint, fetcher, requestTimeoutMs, compositionId, logger, }: {
|
|
21
21
|
graphRef: string;
|
|
22
22
|
apiKey: string;
|
|
23
23
|
endpoint: string;
|
|
24
24
|
errorReportingEndpoint?: string;
|
|
25
25
|
fetcher: Fetcher;
|
|
26
|
+
requestTimeoutMs: number;
|
|
26
27
|
compositionId: string | null;
|
|
27
|
-
logger
|
|
28
|
-
}): Promise<
|
|
28
|
+
logger: Logger;
|
|
29
|
+
}): Promise<SupergraphSdlUpdate | null>;
|
|
29
30
|
//# sourceMappingURL=loadSupergraphSdlFromStorage.d.ts.map
|
package/dist/supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadSupergraphSdlFromStorage.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loadSupergraphSdlFromStorage.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAInD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC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.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.loadSupergraphSdlFromStorage = exports.loadSupergraphSdlFromUplinks = exports.UplinkFetcherError = exports.SUPERGRAPH_SDL_QUERY = void 0;
|
|
7
7
|
const async_retry_1 = __importDefault(require("async-retry"));
|
|
8
|
+
const node_abort_controller_1 = require("node-abort-controller");
|
|
8
9
|
const outOfBandReporter_1 = require("./outOfBandReporter");
|
|
9
10
|
exports.SUPERGRAPH_SDL_QUERY = `#graphql
|
|
10
11
|
query SupergraphSdl($apiKey: String!, $ref: String!, $ifAfterId: ID) {
|
|
@@ -31,27 +32,26 @@ class UplinkFetcherError extends Error {
|
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
exports.UplinkFetcherError = UplinkFetcherError;
|
|
34
|
-
async function loadSupergraphSdlFromUplinks({ graphRef, apiKey, endpoints, errorReportingEndpoint, fetcher, compositionId, maxRetries,
|
|
35
|
+
async function loadSupergraphSdlFromUplinks({ graphRef, apiKey, endpoints, errorReportingEndpoint, fetcher, compositionId, maxRetries, requestTimeoutMs, roundRobinSeed, logger, }) {
|
|
35
36
|
return (0, async_retry_1.default)(() => loadSupergraphSdlFromStorage({
|
|
36
37
|
graphRef,
|
|
37
38
|
apiKey,
|
|
38
39
|
endpoint: endpoints[roundRobinSeed++ % endpoints.length],
|
|
39
40
|
errorReportingEndpoint,
|
|
40
41
|
fetcher,
|
|
42
|
+
requestTimeoutMs,
|
|
41
43
|
compositionId,
|
|
42
44
|
logger,
|
|
43
45
|
}), {
|
|
44
46
|
retries: maxRetries,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
logger
|
|
48
|
-
|
|
49
|
-
await new Promise(resolve => setTimeout(resolve, delayMS));
|
|
50
|
-
}
|
|
47
|
+
maxTimeout: 60000,
|
|
48
|
+
onRetry(e, attempt) {
|
|
49
|
+
logger.debug(`Unable to fetch supergraph SDL (attempt ${attempt}), waiting before retry: ${e}`);
|
|
50
|
+
},
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
exports.loadSupergraphSdlFromUplinks = loadSupergraphSdlFromUplinks;
|
|
54
|
-
async function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorReportingEndpoint, fetcher, compositionId, logger, }) {
|
|
54
|
+
async function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorReportingEndpoint, fetcher, requestTimeoutMs, compositionId, logger, }) {
|
|
55
55
|
var _a, _b;
|
|
56
56
|
const requestBody = JSON.stringify({
|
|
57
57
|
query: exports.SUPERGRAPH_SDL_QUERY,
|
|
@@ -61,6 +61,11 @@ async function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorR
|
|
|
61
61
|
ifAfterId: compositionId,
|
|
62
62
|
},
|
|
63
63
|
});
|
|
64
|
+
const controller = new node_abort_controller_1.AbortController();
|
|
65
|
+
const signal = setTimeout(() => {
|
|
66
|
+
logger.debug(`Aborting request due to timeout`);
|
|
67
|
+
controller.abort();
|
|
68
|
+
}, requestTimeoutMs);
|
|
64
69
|
const requestDetails = {
|
|
65
70
|
method: 'POST',
|
|
66
71
|
body: requestBody,
|
|
@@ -70,11 +75,12 @@ async function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorR
|
|
|
70
75
|
'user-agent': `${name}/${version}`,
|
|
71
76
|
'content-type': 'application/json',
|
|
72
77
|
},
|
|
78
|
+
signal: controller.signal,
|
|
73
79
|
};
|
|
80
|
+
logger.debug(`🔧 Fetching ${graphRef} supergraph schema from ${endpoint} ifAfterId ${compositionId}`);
|
|
74
81
|
const startTime = new Date();
|
|
75
82
|
let result;
|
|
76
83
|
try {
|
|
77
|
-
logger === null || logger === void 0 ? void 0 : logger.debug(`🔧 Fetching supergraph schema from ${endpoint}`);
|
|
78
84
|
result = await fetcher(endpoint, requestDetails);
|
|
79
85
|
}
|
|
80
86
|
catch (e) {
|
|
@@ -90,6 +96,9 @@ async function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorR
|
|
|
90
96
|
});
|
|
91
97
|
throw new UplinkFetcherError(fetchErrorMsg + ((_a = e.message) !== null && _a !== void 0 ? _a : e));
|
|
92
98
|
}
|
|
99
|
+
finally {
|
|
100
|
+
clearTimeout(signal);
|
|
101
|
+
}
|
|
93
102
|
const endTime = new Date();
|
|
94
103
|
let response;
|
|
95
104
|
if (result.ok || result.status === 400) {
|
|
@@ -119,7 +128,7 @@ async function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorR
|
|
|
119
128
|
const { routerConfig } = response.data;
|
|
120
129
|
if (routerConfig.__typename === 'RouterConfigResult') {
|
|
121
130
|
const { id, supergraphSdl, minDelaySeconds, } = routerConfig;
|
|
122
|
-
return { id, supergraphSdl
|
|
131
|
+
return { id, supergraphSdl, minDelaySeconds };
|
|
123
132
|
}
|
|
124
133
|
else if (routerConfig.__typename === 'FetchError') {
|
|
125
134
|
const { code, message } = routerConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadSupergraphSdlFromStorage.js","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.ts"],"names":[],"mappings":";;;;;;AACA,8DAAgC;
|
|
1
|
+
{"version":3,"file":"loadSupergraphSdlFromStorage.js","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.ts"],"names":[],"mappings":";;;;;;AACA,8DAAgC;AAChC,iEAAwD;AAExD,2DAAwE;AAU3D,QAAA,oBAAoB,GAAgB;;;;;;;;;;;;;;;CAehD,CAAC;AAgBF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAE3D,MAAM,aAAa,GAAG,4DAA4D,CAAC;AAEnF,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,I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IAAI,CAAC;KACb;SAAM;QACL,MAAM,IAAI,kBAAkB,CAAC,+CAA+C,CAAC,CAAC;KAC/E;AACH,CAAC;AAxHD,oEAwHC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FetcherResponse } from '@apollo/utils.fetcher';
|
|
2
|
+
import { type AbortableFetcher as Fetcher } from './types';
|
|
2
3
|
export declare const OUT_OF_BAND_REPORTER_QUERY = "#graphql\n mutation OOBReport($input: APIMonitoringReport) {\n reportError(report: $input)\n }\n";
|
|
3
4
|
export declare function submitOutOfBandReportIfConfigured({ error, requestEndpoint, requestBody, endpoint, response, startedAt, endedAt, tags, fetcher, }: {
|
|
4
5
|
error: Error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outOfBandReporter.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/outOfBandReporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"outOfBandReporter.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/outOfBandReporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOxD,OAAO,EAAE,KAAK,gBAAgB,IAAI,OAAO,EAAE,MAAM,SAAS,CAAC;AAG3D,eAAO,MAAM,0BAA0B,0GAItC,CAAC;AAiBF,wBAAsB,iCAAiC,CAAC,EACtD,KAAK,EACL,eAAe,EACf,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAO,GACR,EAAE;IACD,KAAK,EAAE,KAAK,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,iBA6EA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outOfBandReporter.js","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/outOfBandReporter.ts"],"names":[],"mappings":";;;AAEA,mEAI0C;
|
|
1
|
+
{"version":3,"file":"outOfBandReporter.js","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/outOfBandReporter.ts"],"names":[],"mappings":";;;AAEA,mEAI0C;AAI7B,QAAA,0BAA0B,GAAgB;;;;CAItD,CAAC;AAEF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAepD,KAAK,UAAU,iCAAiC,CAAC,EACtD,KAAK,EACL,eAAe,EACf,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAO,GAWR;;IAEC,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO;KACR;IAED,IAAI,SAAoB,CAAC;IACzB,IAAI,CAAC,QAAQ,EAAE;QACb,SAAS,GAAG,wBAAS,CAAC,gBAAgB,CAAC;KACxC;SAAM;QAEL,QAAQ,QAAQ,CAAC,MAAM,EAAE;YACvB,KAAK,GAAG,CAAC;YACT,KAAK,GAAG,CAAC;YACT,KAAK,GAAG;gBACN,SAAS,GAAG,wBAAS,CAAC,WAAW,CAAC;gBAClC,MAAM;YACR,KAAK,GAAG,CAAC;YACT,KAAK,GAAG;gBACN,SAAS,GAAG,wBAAS,CAAC,OAAO,CAAC;gBAC9B,MAAM;YACR,KAAK,GAAG,CAAC;YACT,KAAK,GAAG;gBACN,SAAS,GAAG,wBAAS,CAAC,gBAAgB,CAAC;gBACvC,MAAM;YACR;gBACE,SAAS,GAAG,wBAAS,CAAC,KAAK,CAAC;S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IAAI,KAAK,CAAC,uCAAuC,MAAA,CAAC,CAAC,OAAO,mCAAI,CAAC,EAAE,CAAC,CAAC;KAC1E;AACH,CAAC;AAjGD,8EAiGC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AbortSignal } from 'node-abort-controller';
|
|
2
|
+
import type { Fetcher, FetcherRequestInit } from '@apollo/utils.fetcher';
|
|
3
|
+
export interface AbortableFetcherRequestInit extends FetcherRequestInit {
|
|
4
|
+
signal?: AbortSignal | null | undefined;
|
|
5
|
+
}
|
|
6
|
+
export interface AbortableFetcher extends Fetcher {
|
|
7
|
+
init?: AbortableFetcherRequestInit;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEzE,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,gBAAiB,SAAQ,OAAO;IAC/C,IAAI,CAAC,EAAE,2BAA2B,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkSupergraphManager/types.ts"],"names":[],"mappings":";;AAKC,CAAC;AAID,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apollo/gateway",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.1",
|
|
4
4
|
"description": "Apollo Gateway",
|
|
5
5
|
"author": "Apollo <packages@apollographql.com>",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,17 +25,16 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@apollo/composition": "^2.1.0-alpha.
|
|
28
|
+
"@apollo/composition": "^2.1.0-alpha.1",
|
|
29
29
|
"@apollo/core-schema": "~0.3.0",
|
|
30
|
-
"@apollo/federation-internals": "^2.1.0-alpha.
|
|
31
|
-
"@apollo/query-planner": "^2.1.0-alpha.
|
|
30
|
+
"@apollo/federation-internals": "^2.1.0-alpha.1",
|
|
31
|
+
"@apollo/query-planner": "^2.1.0-alpha.1",
|
|
32
32
|
"@apollo/utils.createhash": "^1.1.0",
|
|
33
33
|
"@apollo/utils.fetcher": "^1.0.0",
|
|
34
34
|
"@apollo/utils.isnodelike": "^1.1.0",
|
|
35
35
|
"@apollo/utils.logger": "^1.0.0",
|
|
36
36
|
"@josephg/resolvable": "^1.0.1",
|
|
37
37
|
"@opentelemetry/api": "^1.0.1",
|
|
38
|
-
"@types/node-fetch": "2.6.1",
|
|
39
38
|
"apollo-reporting-protobuf": "^0.8.0 || ^3.0.0",
|
|
40
39
|
"apollo-server-caching": "^0.7.0 || ^3.0.0",
|
|
41
40
|
"apollo-server-core": "^2.23.0 || ^3.0.0",
|
|
@@ -44,10 +43,11 @@
|
|
|
44
43
|
"async-retry": "^1.3.3",
|
|
45
44
|
"loglevel": "^1.6.1",
|
|
46
45
|
"make-fetch-happen": "^10.1.2",
|
|
47
|
-
"
|
|
46
|
+
"node-abort-controller": "^3.0.1",
|
|
47
|
+
"node-fetch": "^2.6.7"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"graphql": "^16.0.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "d8df6aecd716a9e2dc1f1596b0f114d0ef57fe74"
|
|
53
53
|
}
|