@graphql-hive/gateway-runtime 2.4.0-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a → 2.4.0-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd

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/CHANGELOG.md CHANGED
@@ -1,17 +1,37 @@
1
1
  # @graphql-hive/gateway-runtime
2
2
 
3
- ## 2.4.0-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a
3
+ ## 2.4.0-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd
4
4
  ### Minor Changes
5
5
 
6
6
 
7
7
 
8
- - [#1742](https://github.com/graphql-hive/gateway/pull/1742) [`2aa6bdb`](https://github.com/graphql-hive/gateway/commit/2aa6bdb47f26b1865de557b081ec414dcceda202) Thanks [@ardatan](https://github.com/ardatan)! - New `onQueryPlan` hook to handle query planning with Rust QP
9
-
8
+ - [#1636](https://github.com/graphql-hive/gateway/pull/1636) [`93808dd`](https://github.com/graphql-hive/gateway/commit/93808dd121a5b65ff767122edd5c87629b485907) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - Expose GraphQLError as OpenTelemetry Events.
9
+
10
+ Errors contains in the result of a graphql operation are now reported as standalone OpenTelemetry
11
+ Events (name `graphql.error`) instead of OpenTelemetry Exceptions.
12
+
13
+ This is aligned with the guidance of the Graphql OpenTelemetry working group.
14
+
15
+ It allows to add more graphql specific attributes to errors reported in a response:
16
+
17
+ - `message`: The error message
18
+ - `path`: The path in the operation document from which the error originated
19
+ - `locations`: The list of related locations in the document source
20
+ - `coordinate`: The schema coordinate of the resolver which is the source of the error
21
+
22
+ This brings the experimental support of the `coordinate` error attribute in the Yoga Runtime. For
23
+ security reason, this attribute is purposefully not serialized, to avoid leaking schema information
24
+ to clients.
10
25
 
11
26
  ### Patch Changes
12
27
 
13
28
 
14
29
 
30
+ - [#1636](https://github.com/graphql-hive/gateway/pull/1636) [`9e48a0d`](https://github.com/graphql-hive/gateway/commit/9e48a0de1bd9c93dc9efa48b2785e311d0bebbf2) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates:
31
+
32
+ - Updated dependency [`graphql-yoga@^5.17.0` ↗︎](https://www.npmjs.com/package/graphql-yoga/v/5.17.0) (from `^5.16.2`, in `dependencies`)
33
+
34
+
15
35
  - [#1725](https://github.com/graphql-hive/gateway/pull/1725) [`0ded04f`](https://github.com/graphql-hive/gateway/commit/0ded04f56d9d9dea8c412e2e320fb89815108362) Thanks [@dependabot](https://github.com/apps/dependabot)! - dependencies updates:
16
36
 
17
37
  - Updated dependency [`@graphql-hive/core@^0.15.1` ↗︎](https://www.npmjs.com/package/@graphql-hive/core/v/0.15.1) (from `^0.13.2`, in `dependencies`)
@@ -26,14 +46,14 @@
26
46
  - [#1740](https://github.com/graphql-hive/gateway/pull/1740) [`9cfe2a5`](https://github.com/graphql-hive/gateway/commit/9cfe2a555fcbc9a70ba04b32d6844a7a795de624) Thanks [@dependabot](https://github.com/apps/dependabot)! - dependencies updates:
27
47
 
28
48
  - Updated dependency [`@graphql-yoga/plugin-apollo-usage-report@^0.12.0` ↗︎](https://www.npmjs.com/package/@graphql-yoga/plugin-apollo-usage-report/v/0.12.0) (from `^0.11.2`, in `dependencies`)
29
- - Updated dependencies [[`2aa6bdb`](https://github.com/graphql-hive/gateway/commit/2aa6bdb47f26b1865de557b081ec414dcceda202), [`55173a5`](https://github.com/graphql-hive/gateway/commit/55173a55344a07fdf9531efcbaa4cb142fff655e), [`bc6cddd`](https://github.com/graphql-hive/gateway/commit/bc6cddd1c53a012dd02a1d8a7217a28e65cc6ae9), [`bc6cddd`](https://github.com/graphql-hive/gateway/commit/bc6cddd1c53a012dd02a1d8a7217a28e65cc6ae9), [`1dbc653`](https://github.com/graphql-hive/gateway/commit/1dbc6536cb992a705cac7894acca6fe5431b72de), [`bc6cddd`](https://github.com/graphql-hive/gateway/commit/bc6cddd1c53a012dd02a1d8a7217a28e65cc6ae9)]:
30
- - @graphql-mesh/fusion-runtime@1.6.0-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a
31
- - @graphql-tools/stitch@10.1.4-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a
32
- - @graphql-tools/wrap@11.1.0-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a
33
- - @graphql-tools/delegate@12.0.0-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a
49
+ - Updated dependencies [[`9e48a0d`](https://github.com/graphql-hive/gateway/commit/9e48a0de1bd9c93dc9efa48b2785e311d0bebbf2), [`55173a5`](https://github.com/graphql-hive/gateway/commit/55173a55344a07fdf9531efcbaa4cb142fff655e), [`bc6cddd`](https://github.com/graphql-hive/gateway/commit/bc6cddd1c53a012dd02a1d8a7217a28e65cc6ae9), [`bc6cddd`](https://github.com/graphql-hive/gateway/commit/bc6cddd1c53a012dd02a1d8a7217a28e65cc6ae9), [`1dbc653`](https://github.com/graphql-hive/gateway/commit/1dbc6536cb992a705cac7894acca6fe5431b72de), [`bc6cddd`](https://github.com/graphql-hive/gateway/commit/bc6cddd1c53a012dd02a1d8a7217a28e65cc6ae9)]:
50
+ - @graphql-mesh/fusion-runtime@1.6.0-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd
51
+ - @graphql-tools/stitch@10.1.4-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd
52
+ - @graphql-tools/wrap@11.1.0-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd
53
+ - @graphql-tools/delegate@12.0.0-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd
34
54
  - @graphql-mesh/hmac-upstream-signature@2.0.8
35
- - @graphql-tools/federation@4.2.4-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a
36
- - @graphql-tools/batch-delegate@10.0.6-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a
55
+ - @graphql-tools/federation@4.2.4-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd
56
+ - @graphql-tools/batch-delegate@10.0.6-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd
37
57
 
38
58
  ## 2.3.5
39
59
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -143,7 +143,8 @@ const getExecuteFnFromExecutor = utils.memoize1(
143
143
  operationName: args.operationName ?? void 0,
144
144
  rootValue: args.rootValue,
145
145
  context: args.contextValue,
146
- signal: args.signal
146
+ signal: args.signal,
147
+ schemaCoordinateInErrors: args.schemaCoordinateInErrors
147
148
  });
148
149
  };
149
150
  }
@@ -1361,52 +1362,6 @@ function usePropagateHeaders(opts) {
1361
1362
  };
1362
1363
  }
1363
1364
 
1364
- function useMaybeQueryPlanDebug({
1365
- log
1366
- }) {
1367
- let activePlugin;
1368
- return {
1369
- onPluginInit({ plugins }) {
1370
- let shouldLog = false;
1371
- log.debug(() => shouldLog = true);
1372
- if (shouldLog) {
1373
- activePlugin = useQueryPlanDebug();
1374
- plugins.push(
1375
- // @ts-expect-error TODO: fix types
1376
- activePlugin
1377
- );
1378
- } else if (activePlugin) {
1379
- const index = plugins.indexOf(
1380
- // @ts-expect-error TODO: fix types
1381
- activePlugin
1382
- );
1383
- if (
1384
- // must be
1385
- index > -1
1386
- ) {
1387
- plugins.splice(index, 1);
1388
- }
1389
- activePlugin = void 0;
1390
- }
1391
- }
1392
- };
1393
- }
1394
- function useQueryPlanDebug() {
1395
- return {
1396
- onQueryPlan({ executionRequest }) {
1397
- return ({ queryPlan }) => {
1398
- executionRequest.context?.log.debug(
1399
- {
1400
- queryPlan,
1401
- operationName: executionRequest.operationName || "Anonymous"
1402
- },
1403
- `[useQueryPlanDebug] `
1404
- );
1405
- };
1406
- }
1407
- };
1408
- }
1409
-
1410
1365
  const defaultGenerateRequestId = ({
1411
1366
  fetchAPI = globalThis
1412
1367
  }) => fetchAPI.crypto.randomUUID();
@@ -2056,7 +2011,6 @@ function createGatewayRuntime(config) {
2056
2011
  const onDelegateHooks = [];
2057
2012
  const onDelegationPlanHooks = [];
2058
2013
  const onDelegationStageExecuteHooks = [];
2059
- const onQueryPlanHooks = [];
2060
2014
  let unifiedGraph;
2061
2015
  let schemaInvalidator;
2062
2016
  let getSchema = () => unifiedGraph;
@@ -2522,7 +2476,6 @@ function createGatewayRuntime(config) {
2522
2476
  onSubgraphExecuteHooks,
2523
2477
  onDelegationPlanHooks,
2524
2478
  onDelegationStageExecuteHooks,
2525
- onQueryPlanHooks,
2526
2479
  additionalTypeDefs: config.additionalTypeDefs,
2527
2480
  additionalResolvers: config.additionalResolvers,
2528
2481
  instrumentation: () => instrumentation,
@@ -2610,9 +2563,6 @@ function createGatewayRuntime(config) {
2610
2563
  if (plugin.onCacheDelete) {
2611
2564
  onCacheDeleteHooks.push(plugin.onCacheDelete);
2612
2565
  }
2613
- if (plugin.onQueryPlan) {
2614
- onQueryPlanHooks.push(plugin.onQueryPlan);
2615
- }
2616
2566
  }
2617
2567
  }
2618
2568
  };
@@ -2824,8 +2774,7 @@ function createGatewayRuntime(config) {
2824
2774
  useSubgraphExecuteDebug(),
2825
2775
  useFetchDebug(),
2826
2776
  useMaybeDelegationPlanDebug({ log: configContext.log }),
2827
- useCacheDebug({ log: configContext.log }),
2828
- useMaybeQueryPlanDebug({ log: configContext.log })
2777
+ useCacheDebug({ log: configContext.log })
2829
2778
  );
2830
2779
  const yoga = graphqlYoga.createYoga({
2831
2780
  // @ts-expect-error Types???
package/dist/index.js CHANGED
@@ -142,7 +142,8 @@ const getExecuteFnFromExecutor = memoize1(
142
142
  operationName: args.operationName ?? void 0,
143
143
  rootValue: args.rootValue,
144
144
  context: args.contextValue,
145
- signal: args.signal
145
+ signal: args.signal,
146
+ schemaCoordinateInErrors: args.schemaCoordinateInErrors
146
147
  });
147
148
  };
148
149
  }
@@ -1360,52 +1361,6 @@ function usePropagateHeaders(opts) {
1360
1361
  };
1361
1362
  }
1362
1363
 
1363
- function useMaybeQueryPlanDebug({
1364
- log
1365
- }) {
1366
- let activePlugin;
1367
- return {
1368
- onPluginInit({ plugins }) {
1369
- let shouldLog = false;
1370
- log.debug(() => shouldLog = true);
1371
- if (shouldLog) {
1372
- activePlugin = useQueryPlanDebug();
1373
- plugins.push(
1374
- // @ts-expect-error TODO: fix types
1375
- activePlugin
1376
- );
1377
- } else if (activePlugin) {
1378
- const index = plugins.indexOf(
1379
- // @ts-expect-error TODO: fix types
1380
- activePlugin
1381
- );
1382
- if (
1383
- // must be
1384
- index > -1
1385
- ) {
1386
- plugins.splice(index, 1);
1387
- }
1388
- activePlugin = void 0;
1389
- }
1390
- }
1391
- };
1392
- }
1393
- function useQueryPlanDebug() {
1394
- return {
1395
- onQueryPlan({ executionRequest }) {
1396
- return ({ queryPlan }) => {
1397
- executionRequest.context?.log.debug(
1398
- {
1399
- queryPlan,
1400
- operationName: executionRequest.operationName || "Anonymous"
1401
- },
1402
- `[useQueryPlanDebug] `
1403
- );
1404
- };
1405
- }
1406
- };
1407
- }
1408
-
1409
1364
  const defaultGenerateRequestId = ({
1410
1365
  fetchAPI = globalThis
1411
1366
  }) => fetchAPI.crypto.randomUUID();
@@ -2055,7 +2010,6 @@ function createGatewayRuntime(config) {
2055
2010
  const onDelegateHooks = [];
2056
2011
  const onDelegationPlanHooks = [];
2057
2012
  const onDelegationStageExecuteHooks = [];
2058
- const onQueryPlanHooks = [];
2059
2013
  let unifiedGraph;
2060
2014
  let schemaInvalidator;
2061
2015
  let getSchema = () => unifiedGraph;
@@ -2521,7 +2475,6 @@ function createGatewayRuntime(config) {
2521
2475
  onSubgraphExecuteHooks,
2522
2476
  onDelegationPlanHooks,
2523
2477
  onDelegationStageExecuteHooks,
2524
- onQueryPlanHooks,
2525
2478
  additionalTypeDefs: config.additionalTypeDefs,
2526
2479
  additionalResolvers: config.additionalResolvers,
2527
2480
  instrumentation: () => instrumentation,
@@ -2609,9 +2562,6 @@ function createGatewayRuntime(config) {
2609
2562
  if (plugin.onCacheDelete) {
2610
2563
  onCacheDeleteHooks.push(plugin.onCacheDelete);
2611
2564
  }
2612
- if (plugin.onQueryPlan) {
2613
- onQueryPlanHooks.push(plugin.onQueryPlan);
2614
- }
2615
2565
  }
2616
2566
  }
2617
2567
  };
@@ -2823,8 +2773,7 @@ function createGatewayRuntime(config) {
2823
2773
  useSubgraphExecuteDebug(),
2824
2774
  useFetchDebug(),
2825
2775
  useMaybeDelegationPlanDebug({ log: configContext.log }),
2826
- useCacheDebug({ log: configContext.log }),
2827
- useMaybeQueryPlanDebug({ log: configContext.log })
2776
+ useCacheDebug({ log: configContext.log })
2828
2777
  );
2829
2778
  const yoga = createYoga({
2830
2779
  // @ts-expect-error Types???
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-hive/gateway-runtime",
3
- "version": "2.4.0-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a",
3
+ "version": "2.4.0-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,20 +55,20 @@
55
55
  "@graphql-hive/signal": "^2.0.0",
56
56
  "@graphql-hive/yoga": "^0.43.1",
57
57
  "@graphql-mesh/cross-helpers": "^0.4.10",
58
- "@graphql-mesh/fusion-runtime": "1.6.0-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a",
58
+ "@graphql-mesh/fusion-runtime": "1.6.0-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd",
59
59
  "@graphql-mesh/hmac-upstream-signature": "^2.0.8",
60
60
  "@graphql-mesh/plugin-response-cache": "^0.104.18",
61
61
  "@graphql-mesh/transport-common": "^1.0.12",
62
62
  "@graphql-mesh/types": "^0.104.16",
63
63
  "@graphql-mesh/utils": "^0.104.16",
64
- "@graphql-tools/batch-delegate": "10.0.6-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a",
65
- "@graphql-tools/delegate": "12.0.0-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a",
64
+ "@graphql-tools/batch-delegate": "10.0.6-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd",
65
+ "@graphql-tools/delegate": "12.0.0-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd",
66
66
  "@graphql-tools/executor-common": "^1.0.5",
67
67
  "@graphql-tools/executor-http": "^3.0.7",
68
- "@graphql-tools/federation": "4.2.4-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a",
69
- "@graphql-tools/stitch": "10.1.4-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a",
68
+ "@graphql-tools/federation": "4.2.4-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd",
69
+ "@graphql-tools/stitch": "10.1.4-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd",
70
70
  "@graphql-tools/utils": "^10.10.3",
71
- "@graphql-tools/wrap": "11.1.0-alpha-c1d86e45362062c4112896e4bb5d2fab0aea0a3a",
71
+ "@graphql-tools/wrap": "11.1.0-alpha-f06891e88f69e10346ec84690def6c8c57cf3bfd",
72
72
  "@graphql-yoga/plugin-apollo-usage-report": "^0.12.0",
73
73
  "@graphql-yoga/plugin-csrf-prevention": "^3.16.2",
74
74
  "@graphql-yoga/plugin-defer-stream": "^3.16.2",
@@ -79,7 +79,7 @@
79
79
  "@whatwg-node/server": "^0.10.17",
80
80
  "@whatwg-node/server-plugin-cookies": "^1.0.5",
81
81
  "graphql-ws": "^6.0.6",
82
- "graphql-yoga": "^5.16.2",
82
+ "graphql-yoga": "^5.17.0",
83
83
  "tslib": "^2.8.1"
84
84
  },
85
85
  "devDependencies": {