@apollo/gateway 2.0.2-alpha.1 → 2.0.3

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.
Files changed (45) hide show
  1. package/dist/config.d.ts +2 -2
  2. package/dist/config.d.ts.map +1 -1
  3. package/dist/datasources/RemoteGraphQLDataSource.d.ts +6 -5
  4. package/dist/datasources/RemoteGraphQLDataSource.d.ts.map +1 -1
  5. package/dist/datasources/RemoteGraphQLDataSource.js +16 -11
  6. package/dist/datasources/RemoteGraphQLDataSource.js.map +1 -1
  7. package/dist/executeQueryPlan.d.ts.map +1 -1
  8. package/dist/executeQueryPlan.js +2 -2
  9. package/dist/executeQueryPlan.js.map +1 -1
  10. package/dist/index.d.ts +0 -4
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +2 -20
  13. package/dist/index.js.map +1 -1
  14. package/dist/supergraphManagers/UplinkFetcher/index.d.ts +2 -2
  15. package/dist/supergraphManagers/UplinkFetcher/index.d.ts.map +1 -1
  16. package/dist/supergraphManagers/UplinkFetcher/index.js.map +1 -1
  17. package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.d.ts +3 -3
  18. package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.d.ts.map +1 -1
  19. package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.js +14 -13
  20. package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.js.map +1 -1
  21. package/dist/supergraphManagers/UplinkFetcher/outOfBandReporter.d.ts +6 -5
  22. package/dist/supergraphManagers/UplinkFetcher/outOfBandReporter.d.ts.map +1 -1
  23. package/dist/supergraphManagers/UplinkFetcher/outOfBandReporter.js +3 -3
  24. package/dist/supergraphManagers/UplinkFetcher/outOfBandReporter.js.map +1 -1
  25. package/package.json +7 -7
  26. package/src/__generated__/graphqlTypes.ts +1 -1
  27. package/src/__tests__/executeQueryPlan.test.ts +0 -1
  28. package/src/__tests__/gateway/buildService.test.ts +81 -83
  29. package/src/__tests__/gateway/executor.test.ts +20 -17
  30. package/src/__tests__/gateway/lifecycle-hooks.test.ts +1 -1
  31. package/src/__tests__/gateway/opentelemetry.test.ts +3 -7
  32. package/src/__tests__/gateway/supergraphSdl.test.ts +6 -11
  33. package/src/config.ts +2 -2
  34. package/src/datasources/RemoteGraphQLDataSource.ts +32 -16
  35. package/src/datasources/__tests__/RemoteGraphQLDataSource.test.ts +106 -140
  36. package/src/executeQueryPlan.ts +5 -1
  37. package/src/index.ts +3 -26
  38. package/src/supergraphManagers/IntrospectAndCompose/__tests__/IntrospectAndCompose.test.ts +0 -6
  39. package/src/supergraphManagers/UplinkFetcher/__tests__/loadSupergraphSdlFromStorage.test.ts +70 -74
  40. package/src/supergraphManagers/UplinkFetcher/index.ts +2 -2
  41. package/src/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.ts +23 -17
  42. package/src/supergraphManagers/UplinkFetcher/outOfBandReporter.ts +9 -7
  43. package/src/__mocks__/apollo-server-env.ts +0 -56
  44. package/src/__mocks__/make-fetch-happen-fetcher.ts +0 -57
  45. 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
- }