@graphql-tools/batch-execute 8.3.3 → 8.4.0-alpha-bd5ea4d7.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 (3) hide show
  1. package/index.js +8 -1
  2. package/index.mjs +8 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -56,7 +56,7 @@ function parseKey(prefixedKey) {
56
56
  * }
57
57
  */
58
58
  function mergeRequests(requests, extensionsReducer) {
59
- var _a;
59
+ var _a, _b, _c, _d, _e;
60
60
  const mergedVariables = Object.create(null);
61
61
  const mergedVariableDefinitions = [];
62
62
  const mergedSelections = [];
@@ -90,6 +90,13 @@ function mergeRequests(requests, extensionsReducer) {
90
90
  selections: mergedSelections,
91
91
  },
92
92
  };
93
+ const operationName = (_b = firstRequest.operationName) !== null && _b !== void 0 ? _b : (_e = (_d = (_c = firstRequest.info) === null || _c === void 0 ? void 0 : _c.operation) === null || _d === void 0 ? void 0 : _d.name) === null || _e === void 0 ? void 0 : _e.value;
94
+ if (operationName) {
95
+ mergedOperationDefinition.name = {
96
+ kind: graphql.Kind.NAME,
97
+ value: operationName,
98
+ };
99
+ }
93
100
  return {
94
101
  document: {
95
102
  kind: graphql.Kind.DOCUMENT,
package/index.mjs CHANGED
@@ -50,7 +50,7 @@ function parseKey(prefixedKey) {
50
50
  * }
51
51
  */
52
52
  function mergeRequests(requests, extensionsReducer) {
53
- var _a;
53
+ var _a, _b, _c, _d, _e;
54
54
  const mergedVariables = Object.create(null);
55
55
  const mergedVariableDefinitions = [];
56
56
  const mergedSelections = [];
@@ -84,6 +84,13 @@ function mergeRequests(requests, extensionsReducer) {
84
84
  selections: mergedSelections,
85
85
  },
86
86
  };
87
+ const operationName = (_b = firstRequest.operationName) !== null && _b !== void 0 ? _b : (_e = (_d = (_c = firstRequest.info) === null || _c === void 0 ? void 0 : _c.operation) === null || _d === void 0 ? void 0 : _d.name) === null || _e === void 0 ? void 0 : _e.value;
88
+ if (operationName) {
89
+ mergedOperationDefinition.name = {
90
+ kind: Kind.NAME,
91
+ value: operationName,
92
+ };
93
+ }
87
94
  return {
88
95
  document: {
89
96
  kind: Kind.DOCUMENT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/batch-execute",
3
- "version": "8.3.3",
3
+ "version": "8.4.0-alpha-bd5ea4d7.0",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {