@graphql-tools/batch-execute
Advanced tools
Comparing version 9.0.12 to 9.0.13-alpha-3b2000e3a6b9e871ed2700b7795f23d2a15358ce
# @graphql-tools/batch-execute | ||
## 9.0.13-alpha-3b2000e3a6b9e871ed2700b7795f23d2a15358ce | ||
### Patch Changes | ||
- [#726](https://github.com/graphql-hive/gateway/pull/726) [`3b2000e`](https://github.com/graphql-hive/gateway/commit/3b2000e3a6b9e871ed2700b7795f23d2a15358ce) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: | ||
- Added dependency [`@whatwg-node/promise-helpers@^1.0.0` ↗︎](https://www.npmjs.com/package/@whatwg-node/promise-helpers/v/1.0.0) (to `dependencies`) | ||
## 9.0.12 | ||
@@ -4,0 +12,0 @@ |
@@ -1,2 +0,3 @@ | ||
import { getOperationASTFromRequest, relocatedError, fakePromise, mapMaybePromise, isAsyncIterable, memoize2of4 } from '@graphql-tools/utils'; | ||
import { getOperationASTFromRequest, relocatedError, isAsyncIterable, memoize2of4 } from '@graphql-tools/utils'; | ||
import { fakePromise, handleMaybePromise } from '@whatwg-node/promise-helpers'; | ||
import DataLoader from 'dataloader'; | ||
@@ -299,4 +300,4 @@ import { Kind, visit } from 'graphql'; | ||
return fakePromise( | ||
mapMaybePromise( | ||
executor(request), | ||
handleMaybePromise( | ||
() => executor(request), | ||
(result) => [result], | ||
@@ -309,10 +310,13 @@ (err) => [err] | ||
return fakePromise( | ||
mapMaybePromise(executor(mergedRequests), (resultBatches) => { | ||
if (isAsyncIterable(resultBatches)) { | ||
throw new Error( | ||
"Executor must not return incremental results for batching" | ||
); | ||
handleMaybePromise( | ||
() => executor(mergedRequests), | ||
(resultBatches) => { | ||
if (isAsyncIterable(resultBatches)) { | ||
throw new Error( | ||
"Executor must not return incremental results for batching" | ||
); | ||
} | ||
return splitResult(resultBatches, requests.length); | ||
} | ||
return splitResult(resultBatches, requests.length); | ||
}) | ||
) | ||
); | ||
@@ -319,0 +323,0 @@ }; |
{ | ||
"name": "@graphql-tools/batch-execute", | ||
"version": "9.0.12", | ||
"version": "9.0.13-alpha-3b2000e3a6b9e871ed2700b7795f23d2a15358ce", | ||
"type": "module", | ||
@@ -42,2 +42,3 @@ "description": "A set of utils for faster development of GraphQL tools", | ||
"@graphql-tools/utils": "^10.8.1", | ||
"@whatwg-node/promise-helpers": "^1.0.0", | ||
"dataloader": "^2.2.3", | ||
@@ -48,5 +49,5 @@ "tslib": "^2.8.1" | ||
"graphql": "^16.9.0", | ||
"pkgroll": "2.10.0" | ||
"pkgroll": "2.11.0" | ||
}, | ||
"sideEffects": false | ||
} |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
53280
668
5
2