@graphql-hive/gateway-runtime 2.5.0-alpha-59307ccb5034b0b2116c4faa27174921b267c388 → 2.5.0-alpha-b079a2654a7efe1afbc720b58220e3474da04a3a

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,37 +1,41 @@
1
1
  # @graphql-hive/gateway-runtime
2
2
 
3
- ## 2.5.0-alpha-59307ccb5034b0b2116c4faa27174921b267c388
3
+ ## 2.5.0-alpha-b079a2654a7efe1afbc720b58220e3474da04a3a
4
4
  ### Minor Changes
5
5
 
6
6
 
7
7
 
8
- - [#1636](https://github.com/graphql-hive/gateway/pull/1636) [`01fd715`](https://github.com/graphql-hive/gateway/commit/01fd7156d6a40f5d855cfa6ba0b78d9bf54564c0) 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.
8
+ - [#1786](https://github.com/graphql-hive/gateway/pull/1786) [`b079a26`](https://github.com/graphql-hive/gateway/commit/b079a2654a7efe1afbc720b58220e3474da04a3a) Thanks [@ardatan](https://github.com/ardatan)! - Respect both \`graphql-client-name\` and \`x-graphql-client-name\` for client name header, and both \`graphql-client-version\` and \`x-graphql-client-version\` for client version header by default if not configured otherwise.
9
+
25
10
 
26
11
  ### Patch Changes
27
12
 
28
13
 
29
14
 
30
- - [#1636](https://github.com/graphql-hive/gateway/pull/1636) [`4602329`](https://github.com/graphql-hive/gateway/commit/4602329266206712c332a73faac50404df1edbdd) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates:
15
+ - [#1784](https://github.com/graphql-hive/gateway/pull/1784) [`15b9e50`](https://github.com/graphql-hive/gateway/commit/15b9e5037fa74f8c1a8e662e196268a88642c27d) Thanks [@dependabot](https://github.com/apps/dependabot)! - dependencies updates:
31
16
 
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
- - Updated dependencies [[`4602329`](https://github.com/graphql-hive/gateway/commit/4602329266206712c332a73faac50404df1edbdd)]:
34
- - @graphql-mesh/fusion-runtime@1.6.3-alpha-59307ccb5034b0b2116c4faa27174921b267c388
17
+ - Updated dependency [`@types/node@^25.0.0` ↗︎](https://www.npmjs.com/package/@types/node/v/25.0.0) (from `^24.10.1`, in `dependencies`)
18
+ - Updated dependencies []:
19
+ - @graphql-mesh/hmac-upstream-signature@2.0.8
20
+ - @graphql-mesh/fusion-runtime@1.6.2
21
+
22
+ ## 2.4.1
23
+ ### Patch Changes
24
+
25
+
26
+
27
+ - [#1777](https://github.com/graphql-hive/gateway/pull/1777) [`7e33249`](https://github.com/graphql-hive/gateway/commit/7e332496179d213cf10f055b282ce30ab68279d1) Thanks [@enisdenjo](https://github.com/enisdenjo)! - Hive console client agent inherits the plugin's root logger
28
+
29
+
30
+
31
+ - [#1781](https://github.com/graphql-hive/gateway/pull/1781) [`db20a29`](https://github.com/graphql-hive/gateway/commit/db20a298c57c717495cbdbcaa6a8aa5b369da909) Thanks [@enisdenjo](https://github.com/enisdenjo)! - Debug is determined by Hive Logger and does not need to be set for Hive Console's plugin
32
+
33
+
34
+
35
+ - [#1781](https://github.com/graphql-hive/gateway/pull/1781) [`db20a29`](https://github.com/graphql-hive/gateway/commit/db20a298c57c717495cbdbcaa6a8aa5b369da909) Thanks [@enisdenjo](https://github.com/enisdenjo)! - Do not print token info by default when using Hive Console
36
+
37
+ - Updated dependencies []:
38
+ - @graphql-mesh/fusion-runtime@1.6.2
35
39
  - @graphql-mesh/hmac-upstream-signature@2.0.8
36
40
 
37
41
  ## 2.4.0
package/dist/index.cjs CHANGED
@@ -58,20 +58,9 @@ function getEnvStr(key, opts = {}) {
58
58
  }
59
59
  return variable?.trim();
60
60
  }
61
- function getEnvBool(key, opts = {}) {
62
- return strToBool(getEnvStr(key, opts));
63
- }
64
61
  function getNodeEnv(opts = {}) {
65
62
  return getEnvStr("NODE_ENV", opts);
66
63
  }
67
- function strToBool(str) {
68
- return ["1", "t", "true", "y", "yes", "on", "enabled"].includes(
69
- (str || "").toLowerCase()
70
- );
71
- }
72
- function isDebug() {
73
- return getEnvBool("DEBUG");
74
- }
75
64
 
76
65
  function checkIfDataSatisfiesSelectionSet(selectionSet, data) {
77
66
  if (Array.isArray(data)) {
@@ -143,8 +132,7 @@ const getExecuteFnFromExecutor = utils.memoize1(
143
132
  operationName: args.operationName ?? void 0,
144
133
  rootValue: args.rootValue,
145
134
  context: args.contextValue,
146
- signal: args.signal,
147
- schemaCoordinateInErrors: args.schemaCoordinateInErrors
135
+ signal: args.signal
148
136
  });
149
137
  };
150
138
  }
@@ -549,6 +537,34 @@ function getProxyExecutor({
549
537
  };
550
538
  }
551
539
 
540
+ const defaultClientNameHeaders = [
541
+ "x-graphql-client-name",
542
+ "graphql-client-name"
543
+ ];
544
+ const defaultClientVersionHeaders = [
545
+ "x-graphql-client-version",
546
+ "graphql-client-version"
547
+ ];
548
+ function lookupHeader(headers, possibleNames) {
549
+ for (const name of possibleNames) {
550
+ const value = headers[name];
551
+ if (value) {
552
+ return value;
553
+ }
554
+ }
555
+ return null;
556
+ }
557
+ function defaultClientInfoFactory(context) {
558
+ const name = lookupHeader(context.headers, defaultClientNameHeaders);
559
+ const version = lookupHeader(context.headers, defaultClientVersionHeaders);
560
+ if (name) {
561
+ return {
562
+ name,
563
+ version: version ?? "unknown"
564
+ };
565
+ }
566
+ return null;
567
+ }
552
568
  function useHiveConsole({
553
569
  enabled,
554
570
  token,
@@ -558,14 +574,13 @@ function useHiveConsole({
558
574
  name: "hive-gateway",
559
575
  version: globalThis.__VERSION__,
560
576
  fetch,
561
- logger: logger.LegacyLogger.from(options.log),
562
577
  ...options.agent
563
578
  };
564
579
  let usage = void 0;
565
580
  if (options.usage && typeof options.usage === "object") {
566
581
  usage = {
567
582
  ...options.usage,
568
- clientInfo: typeof options.usage.clientInfo === "object" ? () => (
583
+ clientInfo: options.usage.clientInfo == null ? defaultClientInfoFactory : typeof options.usage.clientInfo === "object" ? () => (
569
584
  // @ts-expect-error clientInfo will be an object
570
585
  options.usage.clientInfo
571
586
  ) : options.usage.clientInfo
@@ -577,8 +592,8 @@ function useHiveConsole({
577
592
  throw new Error("Hive plugin is enabled but the token is not provided");
578
593
  }
579
594
  return yoga.useHive({
580
- debug: isDebug(),
581
595
  logger: options.log,
596
+ printTokenInfo: false,
582
597
  ...options,
583
598
  enabled: !!enabled,
584
599
  token,
package/dist/index.js CHANGED
@@ -57,20 +57,9 @@ function getEnvStr(key, opts = {}) {
57
57
  }
58
58
  return variable?.trim();
59
59
  }
60
- function getEnvBool(key, opts = {}) {
61
- return strToBool(getEnvStr(key, opts));
62
- }
63
60
  function getNodeEnv(opts = {}) {
64
61
  return getEnvStr("NODE_ENV", opts);
65
62
  }
66
- function strToBool(str) {
67
- return ["1", "t", "true", "y", "yes", "on", "enabled"].includes(
68
- (str || "").toLowerCase()
69
- );
70
- }
71
- function isDebug() {
72
- return getEnvBool("DEBUG");
73
- }
74
63
 
75
64
  function checkIfDataSatisfiesSelectionSet(selectionSet, data) {
76
65
  if (Array.isArray(data)) {
@@ -142,8 +131,7 @@ const getExecuteFnFromExecutor = memoize1(
142
131
  operationName: args.operationName ?? void 0,
143
132
  rootValue: args.rootValue,
144
133
  context: args.contextValue,
145
- signal: args.signal,
146
- schemaCoordinateInErrors: args.schemaCoordinateInErrors
134
+ signal: args.signal
147
135
  });
148
136
  };
149
137
  }
@@ -548,6 +536,34 @@ function getProxyExecutor({
548
536
  };
549
537
  }
550
538
 
539
+ const defaultClientNameHeaders = [
540
+ "x-graphql-client-name",
541
+ "graphql-client-name"
542
+ ];
543
+ const defaultClientVersionHeaders = [
544
+ "x-graphql-client-version",
545
+ "graphql-client-version"
546
+ ];
547
+ function lookupHeader(headers, possibleNames) {
548
+ for (const name of possibleNames) {
549
+ const value = headers[name];
550
+ if (value) {
551
+ return value;
552
+ }
553
+ }
554
+ return null;
555
+ }
556
+ function defaultClientInfoFactory(context) {
557
+ const name = lookupHeader(context.headers, defaultClientNameHeaders);
558
+ const version = lookupHeader(context.headers, defaultClientVersionHeaders);
559
+ if (name) {
560
+ return {
561
+ name,
562
+ version: version ?? "unknown"
563
+ };
564
+ }
565
+ return null;
566
+ }
551
567
  function useHiveConsole({
552
568
  enabled,
553
569
  token,
@@ -557,14 +573,13 @@ function useHiveConsole({
557
573
  name: "hive-gateway",
558
574
  version: globalThis.__VERSION__,
559
575
  fetch,
560
- logger: LegacyLogger.from(options.log),
561
576
  ...options.agent
562
577
  };
563
578
  let usage = void 0;
564
579
  if (options.usage && typeof options.usage === "object") {
565
580
  usage = {
566
581
  ...options.usage,
567
- clientInfo: typeof options.usage.clientInfo === "object" ? () => (
582
+ clientInfo: options.usage.clientInfo == null ? defaultClientInfoFactory : typeof options.usage.clientInfo === "object" ? () => (
568
583
  // @ts-expect-error clientInfo will be an object
569
584
  options.usage.clientInfo
570
585
  ) : options.usage.clientInfo
@@ -576,8 +591,8 @@ function useHiveConsole({
576
591
  throw new Error("Hive plugin is enabled but the token is not provided");
577
592
  }
578
593
  return useHive({
579
- debug: isDebug(),
580
594
  logger: options.log,
595
+ printTokenInfo: false,
581
596
  ...options,
582
597
  enabled: !!enabled,
583
598
  token,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-hive/gateway-runtime",
3
- "version": "2.5.0-alpha-59307ccb5034b0b2116c4faa27174921b267c388",
3
+ "version": "2.5.0-alpha-b079a2654a7efe1afbc720b58220e3474da04a3a",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,7 +55,7 @@
55
55
  "@graphql-hive/signal": "^2.0.0",
56
56
  "@graphql-hive/yoga": "^0.46.0",
57
57
  "@graphql-mesh/cross-helpers": "^0.4.10",
58
- "@graphql-mesh/fusion-runtime": "1.6.3-alpha-59307ccb5034b0b2116c4faa27174921b267c388",
58
+ "@graphql-mesh/fusion-runtime": "^1.6.2",
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",
@@ -73,13 +73,13 @@
73
73
  "@graphql-yoga/plugin-csrf-prevention": "^3.16.2",
74
74
  "@graphql-yoga/plugin-defer-stream": "^3.16.2",
75
75
  "@graphql-yoga/plugin-persisted-operations": "^3.16.2",
76
- "@types/node": "^24.10.1",
76
+ "@types/node": "^25.0.0",
77
77
  "@whatwg-node/disposablestack": "^0.0.6",
78
78
  "@whatwg-node/promise-helpers": "^1.3.2",
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.17.0",
82
+ "graphql-yoga": "^5.16.2",
83
83
  "tslib": "^2.8.1"
84
84
  },
85
85
  "devDependencies": {