@graphql-tools/batch-execute
Advanced tools
Comparing version 9.0.7-alpha-9b1d91fdd989af31b55a1be00bb1d5ca145342d6 to 9.0.7-alpha-9edbee66f00abceff2d0a7f6cf80b5705073d5c0
# @graphql-tools/batch-execute | ||
## 9.0.7-alpha-9b1d91fdd989af31b55a1be00bb1d5ca145342d6 | ||
## 9.0.7-alpha-9edbee66f00abceff2d0a7f6cf80b5705073d5c0 | ||
@@ -11,2 +11,10 @@ ### Patch Changes | ||
- [#185](https://github.com/graphql-hive/gateway/pull/185) [`f0b6921`](https://github.com/graphql-hive/gateway/commit/f0b69219fefc1b24c5511a1c623a5e3bbaf5ca0b) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: | ||
- Removed dependency [`value-or-promise@^1.0.12` ↗︎](https://www.npmjs.com/package/value-or-promise/v/1.0.12) (from `dependencies`) | ||
- [#188](https://github.com/graphql-hive/gateway/pull/188) [`f71366d`](https://github.com/graphql-hive/gateway/commit/f71366d234fe8f30a419814fe1460f1e22663241) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: | ||
- Removed dependency [`value-or-promise@^1.0.12` ↗︎](https://www.npmjs.com/package/value-or-promise/v/1.0.12) (from `dependencies`) | ||
## 9.0.5 | ||
@@ -13,0 +21,0 @@ |
@@ -1,4 +0,3 @@ | ||
import { getOperationASTFromRequest, relocatedError, isAsyncIterable, memoize2of4 } from '@graphql-tools/utils'; | ||
import { getOperationASTFromRequest, relocatedError, fakePromise, mapMaybePromise, isAsyncIterable, memoize2of4 } from '@graphql-tools/utils'; | ||
import DataLoader from 'dataloader'; | ||
import { ValueOrPromise } from 'value-or-promise'; | ||
import { Kind, visit } from 'graphql'; | ||
@@ -289,7 +288,13 @@ | ||
const request = requests[0]; | ||
return new ValueOrPromise(() => executor(request)).then((result) => [result]).catch((err) => [err]); | ||
return fakePromise( | ||
mapMaybePromise( | ||
executor(request), | ||
(result) => [result], | ||
(err) => [err] | ||
) | ||
); | ||
} | ||
const mergedRequests = mergeRequests(requests, extensionsReducer); | ||
return new ValueOrPromise(() => executor(mergedRequests)).then( | ||
(resultBatches) => { | ||
return fakePromise( | ||
mapMaybePromise(executor(mergedRequests), (resultBatches) => { | ||
if (isAsyncIterable(resultBatches)) { | ||
@@ -301,3 +306,3 @@ throw new Error( | ||
return splitResult(resultBatches, requests.length); | ||
} | ||
}) | ||
); | ||
@@ -304,0 +309,0 @@ }; |
{ | ||
"name": "@graphql-tools/batch-execute", | ||
"version": "9.0.7-alpha-9b1d91fdd989af31b55a1be00bb1d5ca145342d6", | ||
"version": "9.0.7-alpha-9edbee66f00abceff2d0a7f6cf80b5705073d5c0", | ||
"type": "module", | ||
@@ -43,4 +43,3 @@ "description": "A set of utils for faster development of GraphQL tools", | ||
"dataloader": "^2.2.2", | ||
"tslib": "^2.4.0", | ||
"value-or-promise": "^1.0.12" | ||
"tslib": "^2.4.0" | ||
}, | ||
@@ -47,0 +46,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48924
4
640
- Removedvalue-or-promise@^1.0.12
- Removedvalue-or-promise@1.0.12(transitive)