@graphql-tools/batch-execute
Advanced tools
Comparing version 9.0.0-rc-20230519104353-b09f3180 to 9.0.0-rc-20230519104627-f6fea064
@@ -43,3 +43,2 @@ "use strict"; | ||
function mergeRequests(requests, extensionsReducer) { | ||
var _a, _b, _c, _d, _e; | ||
const mergedVariables = Object.create(null); | ||
@@ -68,3 +67,3 @@ const mergedVariableDefinitions = []; | ||
const firstRequest = requests[0]; | ||
const operationType = (_a = firstRequest.operationType) !== null && _a !== void 0 ? _a : (0, utils_1.getOperationASTFromRequest)(firstRequest).operation; | ||
const operationType = firstRequest.operationType ?? (0, utils_1.getOperationASTFromRequest)(firstRequest).operation; | ||
const mergedOperationDefinition = { | ||
@@ -79,3 +78,3 @@ kind: graphql_1.Kind.OPERATION_DEFINITION, | ||
}; | ||
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; | ||
const operationName = firstRequest.operationName ?? firstRequest.info?.operation?.name?.value; | ||
if (operationName) { | ||
@@ -101,4 +100,3 @@ mergedOperationDefinition.name = { | ||
function prefixRequest(prefix, request) { | ||
var _a; | ||
const executionVariables = (_a = request.variables) !== null && _a !== void 0 ? _a : {}; | ||
const executionVariables = request.variables ?? {}; | ||
function prefixNode(node) { | ||
@@ -105,0 +103,0 @@ return prefixNodeName(node, prefix); |
@@ -40,3 +40,2 @@ // adapted from https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-source-graphql/src/batching/merge-queries.js | ||
export function mergeRequests(requests, extensionsReducer) { | ||
var _a, _b, _c, _d, _e; | ||
const mergedVariables = Object.create(null); | ||
@@ -65,3 +64,3 @@ const mergedVariableDefinitions = []; | ||
const firstRequest = requests[0]; | ||
const operationType = (_a = firstRequest.operationType) !== null && _a !== void 0 ? _a : getOperationASTFromRequest(firstRequest).operation; | ||
const operationType = firstRequest.operationType ?? getOperationASTFromRequest(firstRequest).operation; | ||
const mergedOperationDefinition = { | ||
@@ -76,3 +75,3 @@ kind: Kind.OPERATION_DEFINITION, | ||
}; | ||
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; | ||
const operationName = firstRequest.operationName ?? firstRequest.info?.operation?.name?.value; | ||
if (operationName) { | ||
@@ -97,4 +96,3 @@ mergedOperationDefinition.name = { | ||
function prefixRequest(prefix, request) { | ||
var _a; | ||
const executionVariables = (_a = request.variables) !== null && _a !== void 0 ? _a : {}; | ||
const executionVariables = request.variables ?? {}; | ||
function prefixNode(node) { | ||
@@ -101,0 +99,0 @@ return prefixNodeName(node, prefix); |
{ | ||
"name": "@graphql-tools/batch-execute", | ||
"version": "9.0.0-rc-20230519104353-b09f3180", | ||
"version": "9.0.0-rc-20230519104627-f6fea064", | ||
"description": "A set of utils for faster development of GraphQL tools", | ||
@@ -10,3 +10,3 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@graphql-tools/utils": "10.0.0-rc-20230519104353-b09f3180", | ||
"@graphql-tools/utils": "10.0.0-rc-20230519104627-f6fea064", | ||
"dataloader": "^2.2.2", | ||
@@ -13,0 +13,0 @@ "tslib": "^2.4.0", |
36529
833
+ Added@graphql-tools/utils@10.0.0-rc-20230519104627-f6fea064(transitive)
+ Added@graphql-typed-document-node/core@3.2.0(transitive)
Updated@graphql-tools/utils@10.0.0-rc-20230519104627-f6fea064