@apollo/gateway 2.0.5 → 2.1.0-alpha.0
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.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +7 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -46
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +15 -0
- package/dist/logger.js.map +1 -0
- package/dist/supergraphManagers/UplinkSupergraphManager/index.d.ts +61 -0
- package/dist/supergraphManagers/UplinkSupergraphManager/index.d.ts.map +1 -0
- package/dist/supergraphManagers/UplinkSupergraphManager/index.js +213 -0
- package/dist/supergraphManagers/UplinkSupergraphManager/index.js.map +1 -0
- package/dist/supergraphManagers/{UplinkFetcher → UplinkSupergraphManager}/loadSupergraphSdlFromStorage.d.ts +7 -4
- package/dist/supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.d.ts.map +1 -0
- package/dist/supergraphManagers/{UplinkFetcher → UplinkSupergraphManager}/loadSupergraphSdlFromStorage.js +5 -2
- package/dist/supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.js.map +1 -0
- package/dist/supergraphManagers/{UplinkFetcher → UplinkSupergraphManager}/outOfBandReporter.d.ts +0 -0
- package/dist/supergraphManagers/UplinkSupergraphManager/outOfBandReporter.d.ts.map +1 -0
- package/dist/supergraphManagers/{UplinkFetcher → UplinkSupergraphManager}/outOfBandReporter.js +0 -0
- package/dist/supergraphManagers/UplinkSupergraphManager/outOfBandReporter.js.map +1 -0
- package/dist/supergraphManagers/index.d.ts +2 -2
- package/dist/supergraphManagers/index.d.ts.map +1 -1
- package/dist/supergraphManagers/index.js +17 -4
- package/dist/supergraphManagers/index.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/integration/configuration.test.ts +0 -43
- package/src/__tests__/integration/managed.test.ts +289 -0
- package/src/__tests__/integration/networkRequests.test.ts +4 -31
- package/src/__tests__/integration/nockMocks.ts +7 -6
- package/src/config.ts +2 -0
- package/src/index.ts +26 -67
- package/src/logger.ts +11 -0
- package/src/supergraphManagers/UplinkSupergraphManager/__tests__/UplinkSupergraphManager.test.ts +67 -0
- package/src/supergraphManagers/{UplinkFetcher → UplinkSupergraphManager}/__tests__/loadSupergraphSdlFromStorage.test.ts +0 -0
- package/src/supergraphManagers/{UplinkFetcher → UplinkSupergraphManager}/__tests__/tsconfig.json +0 -0
- package/src/supergraphManagers/UplinkSupergraphManager/index.ts +306 -0
- package/src/supergraphManagers/{UplinkFetcher → UplinkSupergraphManager}/loadSupergraphSdlFromStorage.ts +11 -3
- package/src/supergraphManagers/{UplinkFetcher → UplinkSupergraphManager}/outOfBandReporter.ts +0 -0
- package/src/supergraphManagers/index.ts +2 -2
- package/dist/supergraphManagers/UplinkFetcher/index.d.ts +0 -35
- package/dist/supergraphManagers/UplinkFetcher/index.d.ts.map +0 -1
- package/dist/supergraphManagers/UplinkFetcher/index.js +0 -114
- package/dist/supergraphManagers/UplinkFetcher/index.js.map +0 -1
- package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.d.ts.map +0 -1
- package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.js.map +0 -1
- package/dist/supergraphManagers/UplinkFetcher/outOfBandReporter.d.ts.map +0 -1
- package/dist/supergraphManagers/UplinkFetcher/outOfBandReporter.js.map +0 -1
- package/src/supergraphManagers/UplinkFetcher/index.ts +0 -149
package/src/supergraphManagers/UplinkSupergraphManager/__tests__/UplinkSupergraphManager.test.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import mockedEnv from 'mocked-env';
|
|
2
|
+
|
|
3
|
+
import { UplinkSupergraphManager } from '@apollo/gateway';
|
|
4
|
+
|
|
5
|
+
import { DEFAULT_UPLINK_ENDPOINTS } from '..';
|
|
6
|
+
|
|
7
|
+
let cleanUp: (() => void) | undefined;
|
|
8
|
+
|
|
9
|
+
const logger = {
|
|
10
|
+
warn: jest.fn(),
|
|
11
|
+
debug: jest.fn(),
|
|
12
|
+
error: jest.fn(),
|
|
13
|
+
info: jest.fn(),
|
|
14
|
+
};
|
|
15
|
+
const apiKey = 'OU812';
|
|
16
|
+
const graphRef = 'graph@ref';
|
|
17
|
+
|
|
18
|
+
afterEach(async () => {
|
|
19
|
+
if (cleanUp) {
|
|
20
|
+
cleanUp();
|
|
21
|
+
cleanUp = undefined;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe('UplinkSupergraphManager', () => {
|
|
26
|
+
it('can be minimally constructed', () => {
|
|
27
|
+
new UplinkSupergraphManager({ apiKey, graphRef });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
describe('setting uplink URLs', () => {
|
|
31
|
+
it('uses default uplink URLs', async () => {
|
|
32
|
+
const manager = new UplinkSupergraphManager({ apiKey, graphRef, logger });
|
|
33
|
+
|
|
34
|
+
expect(manager.uplinkEndpoints).toEqual(DEFAULT_UPLINK_ENDPOINTS);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('can set uplink URLs via config', async () => {
|
|
38
|
+
cleanUp = mockedEnv({
|
|
39
|
+
APOLLO_SCHEMA_CONFIG_DELIVERY_ENDPOINT: 'https://env-delivery.com',
|
|
40
|
+
});
|
|
41
|
+
const uplinkEndpoints = [
|
|
42
|
+
'https://config-delivery1.com',
|
|
43
|
+
'https://config-delivery2.com',
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const manager = new UplinkSupergraphManager({
|
|
47
|
+
apiKey,
|
|
48
|
+
graphRef,
|
|
49
|
+
uplinkEndpoints,
|
|
50
|
+
logger,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
expect(manager.uplinkEndpoints).toEqual(uplinkEndpoints);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('can set uplink URLs via environment variable', async () => {
|
|
57
|
+
const uplinkUrl = 'https://env-delivery.com';
|
|
58
|
+
cleanUp = mockedEnv({
|
|
59
|
+
APOLLO_SCHEMA_CONFIG_DELIVERY_ENDPOINT: uplinkUrl,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const manager = new UplinkSupergraphManager({ apiKey, graphRef, logger });
|
|
63
|
+
|
|
64
|
+
expect(manager.uplinkEndpoints).toEqual([uplinkUrl]);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
});
|
|
File without changes
|
package/src/supergraphManagers/{UplinkFetcher → UplinkSupergraphManager}/__tests__/tsconfig.json
RENAMED
|
File without changes
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import * as makeFetchHappen from 'make-fetch-happen';
|
|
2
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
3
|
+
import resolvable, { Resolvable } from '@josephg/resolvable';
|
|
4
|
+
import { SupergraphManager, SupergraphSdlHookOptions } from '../../config';
|
|
5
|
+
import {
|
|
6
|
+
SubgraphHealthCheckFunction,
|
|
7
|
+
SupergraphSdlUpdateFunction,
|
|
8
|
+
} from '../..';
|
|
9
|
+
import { getDefaultLogger } from '../../logger';
|
|
10
|
+
import { loadSupergraphSdlFromUplinks } from './loadSupergraphSdlFromStorage';
|
|
11
|
+
import { Fetcher } from '@apollo/utils.fetcher';
|
|
12
|
+
|
|
13
|
+
export const DEFAULT_UPLINK_ENDPOINTS = [
|
|
14
|
+
'https://uplink.api.apollographql.com/',
|
|
15
|
+
'https://aws.uplink.api.apollographql.com/',
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
function getUplinkEndpoints(): string[] {
|
|
19
|
+
/**
|
|
20
|
+
* Configuration priority order:
|
|
21
|
+
* 1. APOLLO_SCHEMA_CONFIG_DELIVERY_ENDPOINT environment variable
|
|
22
|
+
* 2. default (GCP and AWS)
|
|
23
|
+
*/
|
|
24
|
+
const envEndpoints =
|
|
25
|
+
process.env.APOLLO_SCHEMA_CONFIG_DELIVERY_ENDPOINT?.split(',');
|
|
26
|
+
return envEndpoints ?? DEFAULT_UPLINK_ENDPOINTS;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type FailureToFetchSupergraphSdlFunctionParams = {
|
|
30
|
+
error: Error;
|
|
31
|
+
graphRef: string;
|
|
32
|
+
logger: Logger;
|
|
33
|
+
fetchCount: number;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type FailureToFetchSupergraphSdlDuringInit = ({
|
|
37
|
+
error,
|
|
38
|
+
graphRef,
|
|
39
|
+
logger,
|
|
40
|
+
fetchCount,
|
|
41
|
+
}: FailureToFetchSupergraphSdlFunctionParams) => Promise<string>;
|
|
42
|
+
|
|
43
|
+
export type FailureToFetchSupergraphSdlAfterInit = ({
|
|
44
|
+
error,
|
|
45
|
+
graphRef,
|
|
46
|
+
logger,
|
|
47
|
+
fetchCount,
|
|
48
|
+
mostRecentSuccessfulFetchAt,
|
|
49
|
+
}:
|
|
50
|
+
| FailureToFetchSupergraphSdlFunctionParams
|
|
51
|
+
& { mostRecentSuccessfulFetchAt?: Date }) => Promise<string | null>;
|
|
52
|
+
|
|
53
|
+
type State =
|
|
54
|
+
| { phase: 'constructed' }
|
|
55
|
+
| { phase: 'initialized' }
|
|
56
|
+
| {
|
|
57
|
+
phase: 'polling';
|
|
58
|
+
pollingPromise?: Promise<void>;
|
|
59
|
+
nextFetchPromise?: Resolvable<void>;
|
|
60
|
+
}
|
|
61
|
+
| { phase: 'stopped' };
|
|
62
|
+
|
|
63
|
+
export class UplinkSupergraphManager implements SupergraphManager {
|
|
64
|
+
public readonly uplinkEndpoints: string[] = getUplinkEndpoints();
|
|
65
|
+
private apiKey: string;
|
|
66
|
+
private graphRef: string;
|
|
67
|
+
private fetcher: Fetcher = makeFetchHappen.defaults();
|
|
68
|
+
private maxRetries: number;
|
|
69
|
+
private initialMaxRetries: number;
|
|
70
|
+
private fallbackPollIntervalMs: number = 10_000;
|
|
71
|
+
private logger: Logger;
|
|
72
|
+
private update?: SupergraphSdlUpdateFunction;
|
|
73
|
+
private shouldRunSubgraphHealthcheck: boolean = false;
|
|
74
|
+
private healthCheck?: SubgraphHealthCheckFunction;
|
|
75
|
+
private onFailureToFetchSupergraphSdlDuringInit?: FailureToFetchSupergraphSdlDuringInit;
|
|
76
|
+
private onFailureToFetchSupergraphSdlAfterInit?: FailureToFetchSupergraphSdlAfterInit;
|
|
77
|
+
private timerRef: NodeJS.Timeout | null = null;
|
|
78
|
+
private state: State;
|
|
79
|
+
private errorReportingEndpoint: string | undefined =
|
|
80
|
+
process.env.APOLLO_OUT_OF_BAND_REPORTER_ENDPOINT ?? undefined;
|
|
81
|
+
private compositionId?: string;
|
|
82
|
+
private fetchCount: number = 0;
|
|
83
|
+
private minDelayMs: number | null = null;
|
|
84
|
+
private earliestFetchTime: Date | null = null;
|
|
85
|
+
private mostRecentSuccessfulFetchAt?: Date;
|
|
86
|
+
|
|
87
|
+
constructor({
|
|
88
|
+
apiKey,
|
|
89
|
+
graphRef,
|
|
90
|
+
debug,
|
|
91
|
+
logger,
|
|
92
|
+
fetcher,
|
|
93
|
+
uplinkEndpoints,
|
|
94
|
+
fallbackPollIntervalInMs,
|
|
95
|
+
maxRetries,
|
|
96
|
+
initialMaxRetries,
|
|
97
|
+
shouldRunSubgraphHealthcheck,
|
|
98
|
+
onFailureToFetchSupergraphSdlDuringInit,
|
|
99
|
+
onFailureToFetchSupergraphSdlAfterInit,
|
|
100
|
+
}: {
|
|
101
|
+
apiKey: string;
|
|
102
|
+
graphRef: string;
|
|
103
|
+
debug?: boolean;
|
|
104
|
+
logger?: Logger;
|
|
105
|
+
fetcher?: Fetcher;
|
|
106
|
+
uplinkEndpoints?: string[];
|
|
107
|
+
fallbackPollIntervalInMs?: number;
|
|
108
|
+
maxRetries?: number;
|
|
109
|
+
initialMaxRetries?: number;
|
|
110
|
+
shouldRunSubgraphHealthcheck?: boolean;
|
|
111
|
+
onFailureToFetchSupergraphSdlDuringInit?: FailureToFetchSupergraphSdlDuringInit;
|
|
112
|
+
onFailureToFetchSupergraphSdlAfterInit?: FailureToFetchSupergraphSdlAfterInit;
|
|
113
|
+
}) {
|
|
114
|
+
this.apiKey = apiKey;
|
|
115
|
+
this.graphRef = graphRef;
|
|
116
|
+
this.logger = logger ?? getDefaultLogger(debug);
|
|
117
|
+
|
|
118
|
+
this.uplinkEndpoints = uplinkEndpoints ?? this.uplinkEndpoints;
|
|
119
|
+
// If the user didn't pass a `maxRetries`, default to trying each endpoint
|
|
120
|
+
// 3 times (minus 1 for the initial request) since we round-robin through
|
|
121
|
+
// each URL on failure
|
|
122
|
+
this.maxRetries = maxRetries ?? this.uplinkEndpoints.length * 3 - 1;
|
|
123
|
+
this.initialMaxRetries = initialMaxRetries ?? this.maxRetries;
|
|
124
|
+
|
|
125
|
+
this.fetcher = fetcher ?? this.fetcher;
|
|
126
|
+
this.fallbackPollIntervalMs =
|
|
127
|
+
fallbackPollIntervalInMs ?? this.fallbackPollIntervalMs;
|
|
128
|
+
this.shouldRunSubgraphHealthcheck =
|
|
129
|
+
shouldRunSubgraphHealthcheck ?? this.shouldRunSubgraphHealthcheck;
|
|
130
|
+
this.onFailureToFetchSupergraphSdlDuringInit =
|
|
131
|
+
onFailureToFetchSupergraphSdlDuringInit;
|
|
132
|
+
this.onFailureToFetchSupergraphSdlAfterInit =
|
|
133
|
+
onFailureToFetchSupergraphSdlAfterInit;
|
|
134
|
+
|
|
135
|
+
this.state = { phase: 'constructed' };
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
public async initialize({ update, healthCheck }: SupergraphSdlHookOptions) {
|
|
139
|
+
this.update = update;
|
|
140
|
+
|
|
141
|
+
if (this.shouldRunSubgraphHealthcheck) {
|
|
142
|
+
this.healthCheck = healthCheck;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
let initialSupergraphSdl: string | undefined = undefined;
|
|
146
|
+
try {
|
|
147
|
+
const result = await this.updateSupergraphSdl(this.initialMaxRetries);
|
|
148
|
+
if (!result) {
|
|
149
|
+
throw new Error(
|
|
150
|
+
'Invalid supergraph schema supplied during initialization.',
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
initialSupergraphSdl = result.supergraphSdl;
|
|
154
|
+
if (result.minDelaySeconds) {
|
|
155
|
+
this.minDelayMs = 1000 * result.minDelaySeconds;
|
|
156
|
+
this.earliestFetchTime = new Date(Date.now() + this.minDelayMs);
|
|
157
|
+
}
|
|
158
|
+
} catch (e) {
|
|
159
|
+
this.logUpdateFailure(e);
|
|
160
|
+
throw e;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
this.state = { phase: 'initialized' };
|
|
164
|
+
|
|
165
|
+
// Start polling after we resolve the first supergraph
|
|
166
|
+
this.beginPolling();
|
|
167
|
+
|
|
168
|
+
return {
|
|
169
|
+
supergraphSdl: initialSupergraphSdl,
|
|
170
|
+
cleanup: async () => {
|
|
171
|
+
if (this.state.phase === 'polling') {
|
|
172
|
+
await this.state.pollingPromise;
|
|
173
|
+
}
|
|
174
|
+
this.state = { phase: 'stopped' };
|
|
175
|
+
if (this.timerRef) {
|
|
176
|
+
clearTimeout(this.timerRef);
|
|
177
|
+
this.timerRef = null;
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
public async nextFetch(): Promise<void | null> {
|
|
184
|
+
if (this.state.phase !== 'polling') {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
return this.state.nextFetchPromise;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
private async updateSupergraphSdl(maxRetries: number): Promise<{
|
|
191
|
+
supergraphSdl: string;
|
|
192
|
+
minDelaySeconds: number;
|
|
193
|
+
} | null> {
|
|
194
|
+
let supergraphSdl;
|
|
195
|
+
let minDelaySeconds = this.fallbackPollIntervalMs / 1000;
|
|
196
|
+
|
|
197
|
+
try {
|
|
198
|
+
const result = await loadSupergraphSdlFromUplinks({
|
|
199
|
+
graphRef: this.graphRef,
|
|
200
|
+
apiKey: this.apiKey,
|
|
201
|
+
endpoints: this.uplinkEndpoints,
|
|
202
|
+
errorReportingEndpoint: this.errorReportingEndpoint,
|
|
203
|
+
fetcher: this.fetcher,
|
|
204
|
+
compositionId: this.compositionId ?? null,
|
|
205
|
+
maxRetries,
|
|
206
|
+
roundRobinSeed: this.fetchCount++,
|
|
207
|
+
earliestFetchTime: this.earliestFetchTime,
|
|
208
|
+
logger: this.logger,
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
if (!result) {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
this.compositionId = result.id;
|
|
216
|
+
|
|
217
|
+
({ supergraphSdl, minDelaySeconds } = result);
|
|
218
|
+
this.mostRecentSuccessfulFetchAt = new Date();
|
|
219
|
+
} catch (e) {
|
|
220
|
+
this.logger.debug(
|
|
221
|
+
`Error fetching supergraphSdl from Uplink during phase '${this.state.phase}'`,
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
if (
|
|
225
|
+
this.state.phase === 'constructed' &&
|
|
226
|
+
this.onFailureToFetchSupergraphSdlDuringInit
|
|
227
|
+
) {
|
|
228
|
+
supergraphSdl = await this.onFailureToFetchSupergraphSdlDuringInit({
|
|
229
|
+
error: e,
|
|
230
|
+
graphRef: this.graphRef,
|
|
231
|
+
logger: this.logger,
|
|
232
|
+
fetchCount: this.fetchCount,
|
|
233
|
+
});
|
|
234
|
+
} else if (
|
|
235
|
+
this.state.phase === 'polling' &&
|
|
236
|
+
this.onFailureToFetchSupergraphSdlAfterInit
|
|
237
|
+
) {
|
|
238
|
+
supergraphSdl = await this.onFailureToFetchSupergraphSdlAfterInit({
|
|
239
|
+
error: e,
|
|
240
|
+
graphRef: this.graphRef,
|
|
241
|
+
logger: this.logger,
|
|
242
|
+
fetchCount: this.fetchCount,
|
|
243
|
+
mostRecentSuccessfulFetchAt: this.mostRecentSuccessfulFetchAt,
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
// This is really an error, but we'll let the caller decide what to do with it
|
|
247
|
+
if (!supergraphSdl) {
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
} else {
|
|
251
|
+
throw e;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// the healthCheck fn is only assigned if it's enabled in the config
|
|
256
|
+
await this.healthCheck?.(supergraphSdl);
|
|
257
|
+
return { supergraphSdl, minDelaySeconds };
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
private beginPolling() {
|
|
261
|
+
this.state = { phase: 'polling' };
|
|
262
|
+
this.poll();
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
private poll() {
|
|
266
|
+
const delay = this.minDelayMs
|
|
267
|
+
? Math.max(this.minDelayMs, this.fallbackPollIntervalMs)
|
|
268
|
+
: this.fallbackPollIntervalMs;
|
|
269
|
+
|
|
270
|
+
if (this.state.phase !== 'polling') {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
this.state.nextFetchPromise = resolvable();
|
|
275
|
+
|
|
276
|
+
this.timerRef = setTimeout(async () => {
|
|
277
|
+
if (this.state.phase === 'polling') {
|
|
278
|
+
const pollingPromise = resolvable();
|
|
279
|
+
this.state.pollingPromise = pollingPromise;
|
|
280
|
+
try {
|
|
281
|
+
const result = await this.updateSupergraphSdl(this.maxRetries);
|
|
282
|
+
if (result?.minDelaySeconds) {
|
|
283
|
+
this.minDelayMs = 1000 * result.minDelaySeconds;
|
|
284
|
+
this.earliestFetchTime = new Date(Date.now() + this.minDelayMs);
|
|
285
|
+
}
|
|
286
|
+
if (result?.supergraphSdl) {
|
|
287
|
+
this.update?.(result.supergraphSdl);
|
|
288
|
+
}
|
|
289
|
+
} catch (e) {
|
|
290
|
+
this.logUpdateFailure(e);
|
|
291
|
+
}
|
|
292
|
+
pollingPromise.resolve();
|
|
293
|
+
this.state.nextFetchPromise?.resolve();
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
this.poll();
|
|
297
|
+
}, delay);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
private logUpdateFailure(e: any) {
|
|
301
|
+
this.logger.error(
|
|
302
|
+
'UplinkSupergraphManager failed to update supergraph with the following error: ' +
|
|
303
|
+
(e.message ?? e),
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
FetcherResponse,
|
|
9
9
|
FetcherRequestInit,
|
|
10
10
|
} from '@apollo/utils.fetcher';
|
|
11
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
11
12
|
|
|
12
13
|
// Magic /* GraphQL */ comment below is for codegen, do not remove
|
|
13
14
|
export const SUPERGRAPH_SDL_QUERY = /* GraphQL */`#graphql
|
|
@@ -62,6 +63,7 @@ export async function loadSupergraphSdlFromUplinks({
|
|
|
62
63
|
maxRetries,
|
|
63
64
|
roundRobinSeed,
|
|
64
65
|
earliestFetchTime,
|
|
66
|
+
logger,
|
|
65
67
|
}: {
|
|
66
68
|
graphRef: string;
|
|
67
69
|
apiKey: string;
|
|
@@ -71,8 +73,9 @@ export async function loadSupergraphSdlFromUplinks({
|
|
|
71
73
|
compositionId: string | null;
|
|
72
74
|
maxRetries: number,
|
|
73
75
|
roundRobinSeed: number,
|
|
74
|
-
earliestFetchTime: Date | null
|
|
75
|
-
|
|
76
|
+
earliestFetchTime: Date | null,
|
|
77
|
+
logger?: Logger | undefined,
|
|
78
|
+
}) : Promise<Required<SupergraphSdlUpdate> | null> {
|
|
76
79
|
// This Promise resolves with either an updated supergraph or null if no change.
|
|
77
80
|
// This Promise can reject in the case that none of the retries are successful,
|
|
78
81
|
// in which case it will reject with the most frequently encountered error.
|
|
@@ -85,11 +88,13 @@ export async function loadSupergraphSdlFromUplinks({
|
|
|
85
88
|
errorReportingEndpoint,
|
|
86
89
|
fetcher,
|
|
87
90
|
compositionId,
|
|
91
|
+
logger,
|
|
88
92
|
}),
|
|
89
93
|
{
|
|
90
94
|
retries: maxRetries,
|
|
91
95
|
onRetry: async () => {
|
|
92
96
|
const delayMS = earliestFetchTime ? earliestFetchTime.getTime() - Date.now(): 0;
|
|
97
|
+
logger?.debug(`Waiting ${delayMS}ms before retrying (earliest fetch time ${earliestFetchTime})...`);
|
|
93
98
|
if (delayMS > 0) await new Promise(resolve => setTimeout(resolve, delayMS));
|
|
94
99
|
}
|
|
95
100
|
},
|
|
@@ -104,6 +109,7 @@ export async function loadSupergraphSdlFromStorage({
|
|
|
104
109
|
errorReportingEndpoint,
|
|
105
110
|
fetcher,
|
|
106
111
|
compositionId,
|
|
112
|
+
logger,
|
|
107
113
|
}: {
|
|
108
114
|
graphRef: string;
|
|
109
115
|
apiKey: string;
|
|
@@ -111,7 +117,8 @@ export async function loadSupergraphSdlFromStorage({
|
|
|
111
117
|
errorReportingEndpoint?: string;
|
|
112
118
|
fetcher: Fetcher;
|
|
113
119
|
compositionId: string | null;
|
|
114
|
-
|
|
120
|
+
logger?: Logger | undefined;
|
|
121
|
+
}) : Promise<Required<SupergraphSdlUpdate> | null> {
|
|
115
122
|
const requestBody = JSON.stringify({
|
|
116
123
|
query: SUPERGRAPH_SDL_QUERY,
|
|
117
124
|
variables: {
|
|
@@ -135,6 +142,7 @@ export async function loadSupergraphSdlFromStorage({
|
|
|
135
142
|
const startTime = new Date();
|
|
136
143
|
let result: FetcherResponse;
|
|
137
144
|
try {
|
|
145
|
+
logger?.debug(`🔧 Fetching supergraph schema from ${endpoint}`);
|
|
138
146
|
result = await fetcher(endpoint, requestDetails);
|
|
139
147
|
} catch (e) {
|
|
140
148
|
const endTime = new Date();
|
package/src/supergraphManagers/{UplinkFetcher → UplinkSupergraphManager}/outOfBandReporter.ts
RENAMED
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { LocalCompose } from './LocalCompose';
|
|
2
2
|
export { LegacyFetcher } from './LegacyFetcher';
|
|
3
3
|
export { IntrospectAndCompose } from './IntrospectAndCompose';
|
|
4
|
-
export
|
|
5
|
-
export { UplinkFetcherError } from './
|
|
4
|
+
export * from './UplinkSupergraphManager';
|
|
5
|
+
export { UplinkFetcherError } from './UplinkSupergraphManager/loadSupergraphSdlFromStorage';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '@apollo/utils.logger';
|
|
2
|
-
import { SupergraphManager, SupergraphSdlHookOptions } from '../../config';
|
|
3
|
-
import { Fetcher } from '@apollo/utils.fetcher';
|
|
4
|
-
export interface UplinkFetcherOptions {
|
|
5
|
-
fallbackPollIntervalInMs: number;
|
|
6
|
-
subgraphHealthCheck?: boolean;
|
|
7
|
-
graphRef: string;
|
|
8
|
-
apiKey: string;
|
|
9
|
-
fetcher: Fetcher;
|
|
10
|
-
maxRetries: number;
|
|
11
|
-
uplinkEndpoints: string[];
|
|
12
|
-
logger?: Logger;
|
|
13
|
-
}
|
|
14
|
-
export declare class UplinkFetcher implements SupergraphManager {
|
|
15
|
-
private config;
|
|
16
|
-
private update?;
|
|
17
|
-
private healthCheck?;
|
|
18
|
-
private timerRef;
|
|
19
|
-
private state;
|
|
20
|
-
private errorReportingEndpoint;
|
|
21
|
-
private compositionId?;
|
|
22
|
-
private fetchCount;
|
|
23
|
-
private minDelayMs;
|
|
24
|
-
private earliestFetchTime;
|
|
25
|
-
constructor(options: UplinkFetcherOptions);
|
|
26
|
-
initialize({ update, healthCheck }: SupergraphSdlHookOptions): Promise<{
|
|
27
|
-
supergraphSdl: string;
|
|
28
|
-
cleanup: () => Promise<void>;
|
|
29
|
-
}>;
|
|
30
|
-
private updateSupergraphSdl;
|
|
31
|
-
private beginPolling;
|
|
32
|
-
private poll;
|
|
33
|
-
private logUpdateFailure;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkFetcher/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAG3E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,MAAM,WAAW,oBAAoB;IACnC,wBAAwB,EAAE,MAAM,CAAC;IACjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAOD,qBAAa,aAAc,YAAW,iBAAiB;IACrD,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,MAAM,CAAC,CAA8B;IAC7C,OAAO,CAAC,WAAW,CAAC,CAA8B;IAClD,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,sBAAsB,CACkC;IAChE,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,iBAAiB,CAAqB;gBAElC,OAAO,EAAE,oBAAoB;IAK5B,UAAU,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,wBAAwB;;;;YAyC3D,mBAAmB;IAwBjC,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,IAAI;IA+BZ,OAAO,CAAC,gBAAgB;CAMzB"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.UplinkFetcher = void 0;
|
|
7
|
-
const resolvable_1 = __importDefault(require("@josephg/resolvable"));
|
|
8
|
-
const loadSupergraphSdlFromStorage_1 = require("./loadSupergraphSdlFromStorage");
|
|
9
|
-
class UplinkFetcher {
|
|
10
|
-
constructor(options) {
|
|
11
|
-
var _a;
|
|
12
|
-
this.timerRef = null;
|
|
13
|
-
this.errorReportingEndpoint = (_a = process.env.APOLLO_OUT_OF_BAND_REPORTER_ENDPOINT) !== null && _a !== void 0 ? _a : undefined;
|
|
14
|
-
this.fetchCount = 0;
|
|
15
|
-
this.minDelayMs = null;
|
|
16
|
-
this.earliestFetchTime = null;
|
|
17
|
-
this.config = options;
|
|
18
|
-
this.state = { phase: 'initialized' };
|
|
19
|
-
}
|
|
20
|
-
async initialize({ update, healthCheck }) {
|
|
21
|
-
this.update = update;
|
|
22
|
-
if (this.config.subgraphHealthCheck) {
|
|
23
|
-
this.healthCheck = healthCheck;
|
|
24
|
-
}
|
|
25
|
-
let initialSupergraphSdl = null;
|
|
26
|
-
try {
|
|
27
|
-
const result = await this.updateSupergraphSdl();
|
|
28
|
-
initialSupergraphSdl = (result === null || result === void 0 ? void 0 : result.supergraphSdl) || null;
|
|
29
|
-
if (result === null || result === void 0 ? void 0 : result.minDelaySeconds) {
|
|
30
|
-
this.minDelayMs = 1000 * (result === null || result === void 0 ? void 0 : result.minDelaySeconds);
|
|
31
|
-
this.earliestFetchTime = new Date(Date.now() + this.minDelayMs);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
catch (e) {
|
|
35
|
-
this.logUpdateFailure(e);
|
|
36
|
-
throw e;
|
|
37
|
-
}
|
|
38
|
-
this.beginPolling();
|
|
39
|
-
return {
|
|
40
|
-
supergraphSdl: initialSupergraphSdl,
|
|
41
|
-
cleanup: async () => {
|
|
42
|
-
if (this.state.phase === 'polling') {
|
|
43
|
-
await this.state.pollingPromise;
|
|
44
|
-
}
|
|
45
|
-
this.state = { phase: 'stopped' };
|
|
46
|
-
if (this.timerRef) {
|
|
47
|
-
clearTimeout(this.timerRef);
|
|
48
|
-
this.timerRef = null;
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
async updateSupergraphSdl() {
|
|
54
|
-
var _a, _b;
|
|
55
|
-
const result = await (0, loadSupergraphSdlFromStorage_1.loadSupergraphSdlFromUplinks)({
|
|
56
|
-
graphRef: this.config.graphRef,
|
|
57
|
-
apiKey: this.config.apiKey,
|
|
58
|
-
endpoints: this.config.uplinkEndpoints,
|
|
59
|
-
errorReportingEndpoint: this.errorReportingEndpoint,
|
|
60
|
-
fetcher: this.config.fetcher,
|
|
61
|
-
compositionId: (_a = this.compositionId) !== null && _a !== void 0 ? _a : null,
|
|
62
|
-
maxRetries: this.config.maxRetries,
|
|
63
|
-
roundRobinSeed: this.fetchCount++,
|
|
64
|
-
earliestFetchTime: this.earliestFetchTime,
|
|
65
|
-
});
|
|
66
|
-
if (!result) {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
this.compositionId = result.id;
|
|
71
|
-
await ((_b = this.healthCheck) === null || _b === void 0 ? void 0 : _b.call(this, result.supergraphSdl));
|
|
72
|
-
const { supergraphSdl, minDelaySeconds } = result;
|
|
73
|
-
return { supergraphSdl, minDelaySeconds };
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
beginPolling() {
|
|
77
|
-
this.state = { phase: 'polling' };
|
|
78
|
-
this.poll();
|
|
79
|
-
}
|
|
80
|
-
poll() {
|
|
81
|
-
this.timerRef = setTimeout(async () => {
|
|
82
|
-
var _a;
|
|
83
|
-
if (this.state.phase === 'polling') {
|
|
84
|
-
const pollingPromise = (0, resolvable_1.default)();
|
|
85
|
-
this.state.pollingPromise = pollingPromise;
|
|
86
|
-
try {
|
|
87
|
-
const result = await this.updateSupergraphSdl();
|
|
88
|
-
const maybeNewSupergraphSdl = (result === null || result === void 0 ? void 0 : result.supergraphSdl) || null;
|
|
89
|
-
if (result === null || result === void 0 ? void 0 : result.minDelaySeconds) {
|
|
90
|
-
this.minDelayMs = 1000 * (result === null || result === void 0 ? void 0 : result.minDelaySeconds);
|
|
91
|
-
this.earliestFetchTime = new Date(Date.now() + this.minDelayMs);
|
|
92
|
-
}
|
|
93
|
-
if (maybeNewSupergraphSdl) {
|
|
94
|
-
(_a = this.update) === null || _a === void 0 ? void 0 : _a.call(this, maybeNewSupergraphSdl);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
catch (e) {
|
|
98
|
-
this.logUpdateFailure(e);
|
|
99
|
-
}
|
|
100
|
-
pollingPromise.resolve();
|
|
101
|
-
}
|
|
102
|
-
this.poll();
|
|
103
|
-
}, this.minDelayMs
|
|
104
|
-
? Math.max(this.minDelayMs, this.config.fallbackPollIntervalInMs)
|
|
105
|
-
: this.config.fallbackPollIntervalInMs);
|
|
106
|
-
}
|
|
107
|
-
logUpdateFailure(e) {
|
|
108
|
-
var _a, _b;
|
|
109
|
-
(_a = this.config.logger) === null || _a === void 0 ? void 0 : _a.error('UplinkFetcher failed to update supergraph with the following error: ' +
|
|
110
|
-
((_b = e.message) !== null && _b !== void 0 ? _b : e));
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
exports.UplinkFetcher = UplinkFetcher;
|
|
114
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkFetcher/index.ts"],"names":[],"mappings":";;;;;;AACA,qEAA6C;AAG7C,iFAA8E;AAmB9E,MAAa,aAAa;IAaxB,YAAY,OAA6B;;QATjC,aAAQ,GAA0B,IAAI,CAAC;QAEvC,2BAAsB,GAC5B,MAAA,OAAO,CAAC,GAAG,CAAC,oCAAoC,mCAAI,SAAS,CAAC;QAExD,eAAU,GAAW,CAAC,CAAC;QACvB,eAAU,GAAkB,IAAI,CAAC;QACjC,sB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,CAAC,CAAC,CACnB,CAAC;IACJ,CAAC;CACF;AA7HD,sCA6HC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loadSupergraphSdlFromStorage.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,KAAK,EACV,OAAO,EAGR,MAAM,uBAAuB,CAAC;AAG/B,eAAO,MAAM,oBAAoB,wXAehC,CAAC;AAoBF,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAI5B;AAED,wBAAsB,4BAA4B,CAAC,EACjD,QAAQ,EACR,MAAM,EACN,SAAS,EACT,sBAAsB,EACtB,OAAO,EACP,aAAa,EACb,UAAU,EACV,cAAc,EACd,iBAAiB,GAClB,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,sBAAsB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,IAAI,GAAG,IAAI,CAAA;CAC/B,GAAI,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAuBvC;AAED,wBAAsB,4BAA4B,CAAC,EACjD,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,sBAAsB,EACtB,OAAO,EACP,aAAa,GACd,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,GAAI,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CA2FvC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loadSupergraphSdlFromStorage.js","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.ts"],"names":[],"mappings":";;;;;;AACA,8DAAgC;AAEhC,2DAAwE;AAS3D,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,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AALD,gDAKC;AAEM,KAAK,UAAU,4BAA4B,CAAC,EACjD,QAAQ,EACR,MAAM,EACN,SAAS,EACT,sBAAsB,EACtB,OAAO,EACP,aAAa,EACb,UAAU,EACV,cAAc,EACd,iBAAiB,GAWlB;IAIC,OAAO,IAAA,qBAAK,EACV,GAAG,EAAE,CACH,4BAA4B,CAAC;QAC3B,QAAQ;QACR,MAAM;QACN,QAAQ,EAAE,SAAS,CAAC,cAAc,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC;QACxD,sBAAsB;QACtB,OAAO;QACP,aAAa;KACd,CAAC,EACJ;QACE,OAAO,EAAE,UAAU;QACnB,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,OAAO,GAAG,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA,CAAC,CAAC,CAAC,CAAC;YAChF,IAAI,OAAO,GAAG,CAAC;gBAAE,MAAM,IAAI,OAAO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EAAE,aAAc,EAAE,eAAe,EAAE,CAAC;KAC/D;SAAM,IAAI,YAAY,CAAC,UAAU,KAAK,YAAY,EAAE;QAEnD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC;QACvC,MAAM,IAAI,kBAAkB,CAAC,GAAG,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;KACrD;SAAM,IAAI,YAAY,CAAC,UAAU,KAAK,WAAW,EAAE;QAClD,OAAO,IAAI,CAAC;KACb;SAAM;QACL,MAAM,IAAI,kBAAkB,CAAC,+CAA+C,CAAC,CAAC;KAC/E;AACH,CAAC;AAzGD,oEAyGC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outOfBandReporter.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkFetcher/outOfBandReporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AASjE,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outOfBandReporter.js","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkFetcher/outOfBandReporter.ts"],"names":[],"m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