@apollo/gateway 2.0.2-alpha.1 → 2.0.2-alpha.2
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 +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/datasources/RemoteGraphQLDataSource.d.ts +6 -5
- package/dist/datasources/RemoteGraphQLDataSource.d.ts.map +1 -1
- package/dist/datasources/RemoteGraphQLDataSource.js +16 -11
- package/dist/datasources/RemoteGraphQLDataSource.js.map +1 -1
- package/dist/executeQueryPlan.d.ts.map +1 -1
- package/dist/executeQueryPlan.js +2 -2
- package/dist/executeQueryPlan.js.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -20
- package/dist/index.js.map +1 -1
- package/dist/supergraphManagers/UplinkFetcher/index.d.ts +2 -2
- package/dist/supergraphManagers/UplinkFetcher/index.d.ts.map +1 -1
- package/dist/supergraphManagers/UplinkFetcher/index.js.map +1 -1
- package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.d.ts +3 -3
- package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.d.ts.map +1 -1
- package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.js +14 -13
- package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.js.map +1 -1
- package/dist/supergraphManagers/UplinkFetcher/outOfBandReporter.d.ts +6 -5
- package/dist/supergraphManagers/UplinkFetcher/outOfBandReporter.d.ts.map +1 -1
- package/dist/supergraphManagers/UplinkFetcher/outOfBandReporter.js +3 -3
- package/dist/supergraphManagers/UplinkFetcher/outOfBandReporter.js.map +1 -1
- package/package.json +7 -7
- package/src/__tests__/gateway/buildService.test.ts +81 -83
- package/src/__tests__/gateway/executor.test.ts +20 -17
- package/src/__tests__/gateway/opentelemetry.test.ts +3 -7
- package/src/__tests__/gateway/supergraphSdl.test.ts +6 -11
- package/src/config.ts +2 -2
- package/src/datasources/RemoteGraphQLDataSource.ts +32 -16
- package/src/datasources/__tests__/RemoteGraphQLDataSource.test.ts +106 -140
- package/src/executeQueryPlan.ts +5 -1
- package/src/index.ts +3 -26
- package/src/supergraphManagers/IntrospectAndCompose/__tests__/IntrospectAndCompose.test.ts +0 -6
- package/src/supergraphManagers/UplinkFetcher/__tests__/loadSupergraphSdlFromStorage.test.ts +70 -74
- package/src/supergraphManagers/UplinkFetcher/index.ts +2 -2
- package/src/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.ts +23 -17
- package/src/supergraphManagers/UplinkFetcher/outOfBandReporter.ts +9 -7
- package/src/__mocks__/apollo-server-env.ts +0 -56
- package/src/__mocks__/make-fetch-happen-fetcher.ts +0 -57
- package/src/make-fetch-happen.d.ts +0 -59
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* We are attempting to get types included natively in this package, but it
|
|
3
|
-
* has not happened, yet!
|
|
4
|
-
*
|
|
5
|
-
* See https://github.com/npm/make-fetch-happen/issues/20
|
|
6
|
-
*/
|
|
7
|
-
declare module 'make-fetch-happen' {
|
|
8
|
-
import {
|
|
9
|
-
Response,
|
|
10
|
-
Request,
|
|
11
|
-
RequestInfo,
|
|
12
|
-
RequestInit,
|
|
13
|
-
} from 'apollo-server-env';
|
|
14
|
-
|
|
15
|
-
// If adding to these options, they should mirror those from `make-fetch-happen`
|
|
16
|
-
// @see: https://github.com/npm/make-fetch-happen/#extra-options
|
|
17
|
-
export interface FetcherOptions {
|
|
18
|
-
cacheManager?: string | CacheManager;
|
|
19
|
-
// @see: https://www.npmjs.com/package/retry#retrytimeoutsoptions
|
|
20
|
-
retry?:
|
|
21
|
-
| boolean
|
|
22
|
-
| number
|
|
23
|
-
| {
|
|
24
|
-
// The maximum amount of times to retry the operation. Default is 10. Seting this to 1 means do it once, then retry it once
|
|
25
|
-
retries?: number;
|
|
26
|
-
// The exponential factor to use. Default is 2.
|
|
27
|
-
factor?: number;
|
|
28
|
-
// The number of milliseconds before starting the first retry. Default is 1000.
|
|
29
|
-
minTimeout?: number;
|
|
30
|
-
// The maximum number of milliseconds between two retries. Default is Infinity.
|
|
31
|
-
maxTimeout?: number;
|
|
32
|
-
// Randomizes the timeouts by multiplying with a factor between 1 to 2. Default is false.
|
|
33
|
-
randomize?: boolean;
|
|
34
|
-
};
|
|
35
|
-
onRetry?(): void;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface CacheManager {
|
|
39
|
-
delete(req: Request): Promise<boolean>;
|
|
40
|
-
put(req: Request, res: Response): Promise<Response>;
|
|
41
|
-
match(req: Request): Promise<Response | undefined>;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* This is an augmentation of the fetch function types provided by `apollo-server-env`
|
|
46
|
-
* @see: https://git.io/JvBwX
|
|
47
|
-
*/
|
|
48
|
-
export interface Fetcher {
|
|
49
|
-
(input?: RequestInfo, init?: RequestInit & FetcherOptions): Promise<
|
|
50
|
-
Response
|
|
51
|
-
>;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
let fetch: Fetcher & {
|
|
55
|
-
defaults(opts?: RequestInit & FetcherOptions): typeof fetch;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default fetch;
|
|
59
|
-
}
|