@apollo/gateway 2.0.0-alpha.4 → 2.0.0-preview.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.
Files changed (47) hide show
  1. package/README.md +7 -5
  2. package/dist/__generated__/graphqlTypes.d.ts +3 -0
  3. package/dist/__generated__/graphqlTypes.d.ts.map +1 -1
  4. package/dist/__generated__/graphqlTypes.js.map +1 -1
  5. package/dist/executeQueryPlan.d.ts.map +1 -1
  6. package/dist/executeQueryPlan.js +4 -3
  7. package/dist/executeQueryPlan.js.map +1 -1
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +9 -3
  11. package/dist/index.js.map +1 -1
  12. package/dist/schema-helper/index.js +5 -1
  13. package/dist/schema-helper/index.js.map +1 -1
  14. package/dist/supergraphManagers/IntrospectAndCompose/index.js.map +1 -1
  15. package/dist/supergraphManagers/LegacyFetcher/index.js +1 -1
  16. package/dist/supergraphManagers/LegacyFetcher/index.js.map +1 -1
  17. package/dist/supergraphManagers/LocalCompose/index.js +1 -1
  18. package/dist/supergraphManagers/LocalCompose/index.js.map +1 -1
  19. package/dist/supergraphManagers/UplinkFetcher/index.d.ts +1 -0
  20. package/dist/supergraphManagers/UplinkFetcher/index.d.ts.map +1 -1
  21. package/dist/supergraphManagers/UplinkFetcher/index.js +2 -0
  22. package/dist/supergraphManagers/UplinkFetcher/index.js.map +1 -1
  23. package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.d.ts +5 -1
  24. package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.d.ts.map +1 -1
  25. package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.js +29 -31
  26. package/dist/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.js.map +1 -1
  27. package/dist/supergraphManagers/index.d.ts +1 -0
  28. package/dist/supergraphManagers/index.d.ts.map +1 -1
  29. package/dist/supergraphManagers/index.js +3 -1
  30. package/dist/supergraphManagers/index.js.map +1 -1
  31. package/package.json +8 -7
  32. package/src/__generated__/graphqlTypes.ts +10 -1
  33. package/src/__tests__/build-query-plan.feature +84 -16
  34. package/src/__tests__/executeQueryPlan.test.ts +256 -1
  35. package/src/__tests__/gateway/lifecycle-hooks.test.ts +8 -2
  36. package/src/__tests__/gateway/supergraphSdl.test.ts +5 -3
  37. package/src/__tests__/integration/abstract-types.test.ts +6 -7
  38. package/src/__tests__/integration/nockMocks.ts +3 -2
  39. package/src/__tests__/integration/value-types.test.ts +4 -4
  40. package/src/executeQueryPlan.ts +4 -0
  41. package/src/index.ts +4 -1
  42. package/src/supergraphManagers/LegacyFetcher/index.ts +1 -1
  43. package/src/supergraphManagers/LocalCompose/index.ts +1 -1
  44. package/src/supergraphManagers/UplinkFetcher/__tests__/loadSupergraphSdlFromStorage.test.ts +82 -28
  45. package/src/supergraphManagers/UplinkFetcher/index.ts +2 -0
  46. package/src/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.ts +31 -26
  47. package/src/supergraphManagers/index.ts +1 -0
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadSupergraphSdlFromStorage = exports.loadSupergraphSdlFromUplinks = exports.SUPERGRAPH_SDL_QUERY = void 0;
6
+ exports.loadSupergraphSdlFromStorage = exports.loadSupergraphSdlFromUplinks = exports.UplinkFetcherError = exports.SUPERGRAPH_SDL_QUERY = void 0;
4
7
  const apollo_server_env_1 = require("apollo-server-env");
8
+ const async_retry_1 = __importDefault(require("async-retry"));
5
9
  const outOfBandReporter_1 = require("./outOfBandReporter");
6
10
  exports.SUPERGRAPH_SDL_QUERY = `#graphql
7
11
  query SupergraphSdl($apiKey: String!, $ref: String!, $ifAfterId: ID) {
@@ -20,30 +24,24 @@ exports.SUPERGRAPH_SDL_QUERY = `#graphql
20
24
  `;
21
25
  const { name, version } = require('../../../package.json');
22
26
  const fetchErrorMsg = "An error occurred while fetching your schema from Apollo: ";
23
- let fetchCounter = 0;
24
- async function loadSupergraphSdlFromUplinks({ graphRef, apiKey, endpoints, errorReportingEndpoint, fetcher, compositionId, maxRetries, }) {
25
- let retries = 0;
26
- let lastException = null;
27
- let result = null;
28
- while (retries++ <= maxRetries && result == null) {
29
- try {
30
- result = await loadSupergraphSdlFromStorage({
31
- graphRef,
32
- apiKey,
33
- endpoint: endpoints[fetchCounter++ % endpoints.length],
34
- errorReportingEndpoint,
35
- fetcher,
36
- compositionId
37
- });
38
- }
39
- catch (e) {
40
- lastException = e;
41
- }
42
- }
43
- if (result === null && lastException !== null) {
44
- throw lastException;
27
+ class UplinkFetcherError extends Error {
28
+ constructor(message) {
29
+ super(message);
30
+ this.name = 'UplinkFetcherError';
45
31
  }
46
- return result;
32
+ }
33
+ exports.UplinkFetcherError = UplinkFetcherError;
34
+ async function loadSupergraphSdlFromUplinks({ graphRef, apiKey, endpoints, errorReportingEndpoint, fetcher, compositionId, maxRetries, roundRobinSeed, }) {
35
+ return (0, async_retry_1.default)(() => loadSupergraphSdlFromStorage({
36
+ graphRef,
37
+ apiKey,
38
+ endpoint: endpoints[roundRobinSeed++ % endpoints.length],
39
+ errorReportingEndpoint,
40
+ fetcher,
41
+ compositionId,
42
+ }), {
43
+ retries: maxRetries,
44
+ });
47
45
  }
48
46
  exports.loadSupergraphSdlFromUplinks = loadSupergraphSdlFromUplinks;
49
47
  async function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorReportingEndpoint, fetcher, compositionId, }) {
@@ -81,7 +79,7 @@ async function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorR
81
79
  endedAt: endTime,
82
80
  fetcher,
83
81
  });
84
- throw new Error(fetchErrorMsg + ((_a = e.message) !== null && _a !== void 0 ? _a : e));
82
+ throw new UplinkFetcherError(fetchErrorMsg + ((_a = e.message) !== null && _a !== void 0 ? _a : e));
85
83
  }
86
84
  const endTime = new Date();
87
85
  let response;
@@ -90,15 +88,15 @@ async function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorR
90
88
  response = await result.json();
91
89
  }
92
90
  catch (e) {
93
- throw new Error((_b = fetchErrorMsg + result.status + ' ' + e.message) !== null && _b !== void 0 ? _b : e);
91
+ throw new UplinkFetcherError((_b = fetchErrorMsg + result.status + ' ' + e.message) !== null && _b !== void 0 ? _b : e);
94
92
  }
95
93
  if ('errors' in response) {
96
- throw new Error([fetchErrorMsg, ...response.errors.map((error) => error.message)].join('\n'));
94
+ throw new UplinkFetcherError([fetchErrorMsg, ...response.errors.map((error) => error.message)].join('\n'));
97
95
  }
98
96
  }
99
97
  else {
100
98
  await (0, outOfBandReporter_1.submitOutOfBandReportIfConfigured)({
101
- error: new Error(fetchErrorMsg + result.status + ' ' + result.statusText),
99
+ error: new UplinkFetcherError(fetchErrorMsg + result.status + ' ' + result.statusText),
102
100
  request,
103
101
  endpoint: errorReportingEndpoint,
104
102
  response: result,
@@ -106,7 +104,7 @@ async function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorR
106
104
  endedAt: endTime,
107
105
  fetcher,
108
106
  });
109
- throw new Error(fetchErrorMsg + result.status + ' ' + result.statusText);
107
+ throw new UplinkFetcherError(fetchErrorMsg + result.status + ' ' + result.statusText);
110
108
  }
111
109
  const { routerConfig } = response.data;
112
110
  if (routerConfig.__typename === 'RouterConfigResult') {
@@ -115,13 +113,13 @@ async function loadSupergraphSdlFromStorage({ graphRef, apiKey, endpoint, errorR
115
113
  }
116
114
  else if (routerConfig.__typename === 'FetchError') {
117
115
  const { code, message } = routerConfig;
118
- throw new Error(`${code}: ${message}`);
116
+ throw new UplinkFetcherError(`${code}: ${message}`);
119
117
  }
120
118
  else if (routerConfig.__typename === 'Unchanged') {
121
119
  return null;
122
120
  }
123
121
  else {
124
- throw new Error('Programming error: unhandled response failure');
122
+ throw new UplinkFetcherError('Programming error: unhandled response failure');
125
123
  }
126
124
  }
127
125
  exports.loadSupergraphSdlFromStorage = loadSupergraphSdlFromStorage;
@@ -1 +1 @@
1
- {"version":3,"file":"loadSupergraphSdlFromStorage.js","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.ts"],"names":[],"mappings":";;;AAAA,yDAA6D;AAG7D,2DAAwE;AAI3D,QAAA,oBAAoB,GAAgB;;;;;;;;;;;;;;CAchD,CAAC;AAgBF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAE3D,MAAM,aAAa,GAAG,4DAA4D,CAAC;AAEnF,IAAI,YAAY,GAAG,CAAC,CAAC;AAEd,KAAK,UAAU,4BAA4B,CAAC,EACjD,QAAQ,EACR,MAAM,EACN,SAAS,EACT,sBAAsB,EACtB,OAAO,EACP,aAAa,EACb,UAAU,GASX;IACC,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,aAAa,GAAG,IAAI,CAAC;IACzB,IAAI,MAAM,GAA+B,IAAI,CAAC;IAC9C,OAAO,OAAO,EAAE,IAAI,UAAU,IAAI,MAAM,IAAI,IAAI,EAAE;QAChD,IAAI;YACF,MAAM,GAAG,MAAM,4BAA4B,CAAC;gBAC1C,QAAQ;gBACR,MAAM;gBACN,QAAQ,EAAE,SAAS,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC;gBACtD,sBAAsB;gBACtB,OAAO;gBACP,aAAa;aACd,CAAC,CAAC;SACJ;QAAC,OAAO,CAAC,EAAE;YACV,aAAa,GAAG,CAAC,CAAC;SACnB;KACF;IACD,IAAI,MAAM,KAAK,IAAI,IAAI,aAAa,KAAK,IAAI,EAAE;QAC7C,MAAM,aAAa,CAAC;KACrB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAtCD,oEAsCC;AAEM,KAAK,UAAU,4BAA4B,CAAC,EACjD,QAAQ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C;SAAM,IAAI,YAAY,CAAC,UAAU,KAAK,WAAW,EAAE;QAClD,OAAO,IAAI,CAAC;KACb;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;KAClE;AACH,CAAC;AAtGD,oEAsGC"}
1
+ {"version":3,"file":"loadSupergraphSdlFromStorage.js","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkFetcher/loadSupergraphSdlFromStorage.ts"],"names":[],"mappings":";;;;;;AAAA,yDAA6D;AAE7D,8DAAgC;AAEhC,2DAAwE;AAI3D,QAAA,oBAAoB,GAAgB;;;;;;;;;;;;;;CAchD,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,GAUf;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;KACpB,CACF,CAAC;AAEJ,CAAC;AArCD,oEAqCC;AAEM,KAAK,UAAU,4BAA4B,CAAC,EACjD,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,sBAAsB,EACtB,OAAO,EACP,aAAa,GAQd;;IACC,IAAI,MAAgB,CAAC;IACrB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AM;QACL,MAAM,IAAI,kBAAkB,CAAC,+CAA+C,CAAC,CAAC;KAC/E;AACH,CAAC;AAtGD,oEAsGC"}
@@ -2,4 +2,5 @@ export { LocalCompose } from './LocalCompose';
2
2
  export { LegacyFetcher } from './LegacyFetcher';
3
3
  export { IntrospectAndCompose } from './IntrospectAndCompose';
4
4
  export { UplinkFetcher } from './UplinkFetcher';
5
+ export { UplinkFetcherError } from './UplinkFetcher/loadSupergraphSdlFromStorage';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/supergraphManagers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/supergraphManagers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAA"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UplinkFetcher = exports.IntrospectAndCompose = exports.LegacyFetcher = exports.LocalCompose = void 0;
3
+ exports.UplinkFetcherError = exports.UplinkFetcher = exports.IntrospectAndCompose = exports.LegacyFetcher = exports.LocalCompose = void 0;
4
4
  var LocalCompose_1 = require("./LocalCompose");
5
5
  Object.defineProperty(exports, "LocalCompose", { enumerable: true, get: function () { return LocalCompose_1.LocalCompose; } });
6
6
  var LegacyFetcher_1 = require("./LegacyFetcher");
@@ -9,4 +9,6 @@ var IntrospectAndCompose_1 = require("./IntrospectAndCompose");
9
9
  Object.defineProperty(exports, "IntrospectAndCompose", { enumerable: true, get: function () { return IntrospectAndCompose_1.IntrospectAndCompose; } });
10
10
  var UplinkFetcher_1 = require("./UplinkFetcher");
11
11
  Object.defineProperty(exports, "UplinkFetcher", { enumerable: true, get: function () { return UplinkFetcher_1.UplinkFetcher; } });
12
+ var loadSupergraphSdlFromStorage_1 = require("./UplinkFetcher/loadSupergraphSdlFromStorage");
13
+ Object.defineProperty(exports, "UplinkFetcherError", { enumerable: true, get: function () { return loadSupergraphSdlFromStorage_1.UplinkFetcherError; } });
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/supergraphManagers/index.ts"],"names":[],"mappings":";;;AAAA,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/supergraphManagers/index.ts"],"names":[],"mappings":";;;AAAA,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,6FAAiF;AAAxE,kIAAA,kBAAkB,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollo/gateway",
3
- "version": "2.0.0-alpha.4",
3
+ "version": "2.0.0-preview.0",
4
4
  "description": "Apollo Gateway",
5
5
  "author": "Apollo <packages@apollographql.com>",
6
6
  "main": "dist/index.js",
@@ -25,12 +25,12 @@
25
25
  "access": "public"
26
26
  },
27
27
  "dependencies": {
28
- "@apollo/composition": "^2.0.0-alpha.4",
29
- "@apollo/core-schema": "^0.2.0",
30
- "@apollo/query-planner": "^2.0.0-alpha.4",
28
+ "@apollo/composition": "^2.0.0-preview.0",
29
+ "@apollo/core-schema": "^0.2.2",
30
+ "@apollo/query-planner": "^2.0.0-preview.0",
31
31
  "@josephg/resolvable": "^1.0.1",
32
32
  "@opentelemetry/api": "^1.0.1",
33
- "@types/node-fetch": "2.5.12",
33
+ "@types/node-fetch": "2.6.1",
34
34
  "apollo-reporting-protobuf": "^0.8.0 || ^3.0.0",
35
35
  "apollo-server-caching": "^0.7.0 || ^3.0.0",
36
36
  "apollo-server-core": "^2.23.0 || ^3.0.0",
@@ -38,13 +38,14 @@
38
38
  "apollo-server-errors": "^2.5.0 || ^3.0.0",
39
39
  "apollo-server-types": "^0.9.0 || ^3.0.0",
40
40
  "apollo-utilities": "^1.3.0",
41
+ "async-retry": "^1.3.3",
41
42
  "loglevel": "^1.6.1",
42
43
  "make-fetch-happen": "^8.0.0",
43
44
  "pretty-format": "^27.0.0",
44
45
  "sha.js": "^2.4.11"
45
46
  },
46
47
  "peerDependencies": {
47
- "graphql": "^15.7.0 || ^16.0.0"
48
+ "graphql": "^16.0.0"
48
49
  },
49
- "gitHead": "c32794a48598bac2e2372c23a2ea74ae187cce85"
50
+ "gitHead": "e76fd3e16bf140ba9b30fe26d48657bccca180dc"
50
51
  }
@@ -41,6 +41,8 @@ export type FetchError = {
41
41
  __typename?: 'FetchError';
42
42
  code: FetchErrorCode;
43
43
  message: Scalars['String'];
44
+ /** Minimum delay before the next fetch should occur, in seconds. */
45
+ minDelaySeconds: Scalars['Float'];
44
46
  };
45
47
 
46
48
  export enum FetchErrorCode {
@@ -111,16 +113,23 @@ export type RouterConfigResponse = FetchError | RouterConfigResult | Unchanged;
111
113
 
112
114
  export type RouterConfigResult = {
113
115
  __typename?: 'RouterConfigResult';
116
+ /** Variant-unique identifier. */
114
117
  id: Scalars['ID'];
115
118
  /** Messages that should be reported back to the operators of this router, eg through logs and/or monitoring. */
116
119
  messages: Array<Message>;
117
- /** The configuration as core schema */
120
+ /** Minimum delay before the next fetch should occur, in seconds. */
121
+ minDelaySeconds: Scalars['Float'];
122
+ /** The configuration as core schema. */
118
123
  supergraphSDL: Scalars['String'];
119
124
  };
120
125
 
126
+ /** Response indicating the router configuration available is not newer than the one passed in `ifAfterId`. */
121
127
  export type Unchanged = {
122
128
  __typename?: 'Unchanged';
129
+ /** Variant-unique identifier for the configuration that remains in place. */
123
130
  id: Scalars['ID'];
131
+ /** Minimum delay before the next fetch should occur, in seconds. */
132
+ minDelaySeconds: Scalars['Float'];
124
133
  };
125
134
 
126
135
  export type SupergraphSdlQueryVariables = Exact<{