@graphql-mesh/hmac-upstream-signature 1.2.19-alpha-46666b03dc63c183695b97fb89eacab35b11ac0a → 1.2.19-alpha-3b389697135636c2837d6a66f7f263834c015e18

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 (2) hide show
  1. package/CHANGELOG.md +27 -3
  2. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @graphql-mesh/hmac-upstream-signature
2
2
 
3
- ## 1.2.19-alpha-46666b03dc63c183695b97fb89eacab35b11ac0a
3
+ ## 1.2.19-alpha-3b389697135636c2837d6a66f7f263834c015e18
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -9,14 +9,38 @@
9
9
  - Added dependency [`@graphql-tools/executor-common@workspace:^` ↗︎](https://www.npmjs.com/package/@graphql-tools/executor-common/v/workspace:^) (to `dependencies`)
10
10
  - Removed dependency [`@graphql-mesh/transport-common@workspace:^` ↗︎](https://www.npmjs.com/package/@graphql-mesh/transport-common/v/workspace:^) (from `dependencies`)
11
11
 
12
- - [#381](https://github.com/graphql-hive/gateway/pull/381) [`73dbe3a`](https://github.com/graphql-hive/gateway/commit/73dbe3a2dabb6b84105c4dac3586696daa3d4fcb) Thanks [@ardatan](https://github.com/ardatan)! - Like HMAC Upstream Signature plugin, different components of the gateway were using different ways of serializing the execution request.
12
+ - [#381](https://github.com/graphql-hive/gateway/pull/381) [`73dbe3a`](https://github.com/graphql-hive/gateway/commit/73dbe3a2dabb6b84105c4dac3586696daa3d4fcb) Thanks [@ardatan](https://github.com/ardatan)! - This is a bugfix with some internal changes, no user action is needed. This bugfix and improvement is done to improve the stability of some components of the gateway;
13
+
14
+ Like HMAC Upstream Signature plugin, different components of the gateway were using different ways of serializing the execution request.
13
15
  Some of them were ignoring `variables` if it is empty, some of not, this was causing the signature generation to be different for the same query.
14
16
  For example, it was working as expected in Proxy mode, but not working as expected in Federation Gateway mode.
15
17
 
16
18
  With this change, now we have a shared helper to serialize the upstream execution request with a memoized `print` function for query AST etc to have a consistent serialization so consistent signature generation for HMAC.
17
19
 
20
+ For example instead of using `print`, you should use `defaultPrintFn` that memoizes `print` operation and also used the string version of it parsed before by Envelop/Yoga.
21
+
22
+ ```diff
23
+ -import { print } from 'graphql';
24
+ -const query = print(parsedQuery);
25
+ +import { defaultPrintFn } from '@graphql-tools/executor-common';
26
+ +const query = defaultPrintFn(parsedQuery);
27
+ ```
28
+
29
+ Or instead of creating objects from `ExecutionRequest`, use `serializeExecutionRequest` helper.
30
+
31
+ ```diff
32
+ -const serializedRequest = {
33
+ - query: print(executionRequest.document),
34
+ - variables: executionRequest.variables,
35
+ - operationName: executionRequest.operationName,
36
+ - extensions: executionRequest.extensions,
37
+ -};
38
+ +import { serializeExecutionRequest } from '@graphql-tools/executor-common';
39
+ +const serializedRequest = serializeExecutionRequest(executionRequest);
40
+ ```
41
+
18
42
  - Updated dependencies [[`73dbe3a`](https://github.com/graphql-hive/gateway/commit/73dbe3a2dabb6b84105c4dac3586696daa3d4fcb)]:
19
- - @graphql-tools/executor-common@0.0.1-alpha-46666b03dc63c183695b97fb89eacab35b11ac0a
43
+ - @graphql-tools/executor-common@0.0.1-alpha-3b389697135636c2837d6a66f7f263834c015e18
20
44
 
21
45
  ## 1.2.18
22
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-mesh/hmac-upstream-signature",
3
- "version": "1.2.19-alpha-46666b03dc63c183695b97fb89eacab35b11ac0a",
3
+ "version": "1.2.19-alpha-3b389697135636c2837d6a66f7f263834c015e18",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -45,13 +45,13 @@
45
45
  "@graphql-mesh/cross-helpers": "^0.4.9",
46
46
  "@graphql-mesh/types": "^0.103.6",
47
47
  "@graphql-mesh/utils": "^0.103.6",
48
- "@graphql-tools/executor-common": "0.0.1-alpha-46666b03dc63c183695b97fb89eacab35b11ac0a",
48
+ "@graphql-tools/executor-common": "0.0.1-alpha-3b389697135636c2837d6a66f7f263834c015e18",
49
49
  "@graphql-tools/utils": "^10.7.0",
50
50
  "json-stable-stringify": "^1.1.1",
51
51
  "tslib": "^2.8.1"
52
52
  },
53
53
  "devDependencies": {
54
- "@graphql-hive/gateway": "1.7.4-alpha-46666b03dc63c183695b97fb89eacab35b11ac0a",
54
+ "@graphql-hive/gateway": "1.7.4-alpha-3b389697135636c2837d6a66f7f263834c015e18",
55
55
  "@types/json-stable-stringify": "^1.1.0",
56
56
  "graphql": "^16.9.0",
57
57
  "graphql-yoga": "^5.10.6",