@graphql-mesh/plugin-deduplicate-request 0.103.19 → 0.103.20

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.
package/cjs/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = useDeduplicateRequest;
4
4
  const utils_1 = require("@graphql-mesh/utils");
5
- const utils_2 = require("@graphql-tools/utils");
5
+ const promise_helpers_1 = require("@whatwg-node/promise-helpers");
6
6
  function useDeduplicateRequest() {
7
7
  const reqResMapByContext = new WeakMap();
8
8
  function getReqResMapByContext(context) {
@@ -36,7 +36,7 @@ function useDeduplicateRequest() {
36
36
  setFetchFn(() => {
37
37
  let dedupRes$ = reqResMap.get(dedupCacheKey);
38
38
  if (dedupRes$ == null) {
39
- dedupRes$ = (0, utils_2.mapMaybePromise)(fetchFn(url, options, context, info), res => {
39
+ dedupRes$ = (0, promise_helpers_1.handleMaybePromise)(() => fetchFn(url, options, context, info), res => {
40
40
  let resPropMapByRes = resPropMap.get(res);
41
41
  if (resPropMapByRes == null) {
42
42
  resPropMapByRes = new Map();
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { getHeadersObj } from '@graphql-mesh/utils';
2
- import { mapMaybePromise } from '@graphql-tools/utils';
2
+ import { handleMaybePromise } from '@whatwg-node/promise-helpers';
3
3
  export default function useDeduplicateRequest() {
4
4
  const reqResMapByContext = new WeakMap();
5
5
  function getReqResMapByContext(context) {
@@ -33,7 +33,7 @@ export default function useDeduplicateRequest() {
33
33
  setFetchFn(() => {
34
34
  let dedupRes$ = reqResMap.get(dedupCacheKey);
35
35
  if (dedupRes$ == null) {
36
- dedupRes$ = mapMaybePromise(fetchFn(url, options, context, info), res => {
36
+ dedupRes$ = handleMaybePromise(() => fetchFn(url, options, context, info), res => {
37
37
  let resPropMapByRes = resPropMap.get(res);
38
38
  if (resPropMapByRes == null) {
39
39
  resPropMapByRes = new Map();
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@graphql-mesh/plugin-deduplicate-request",
3
- "version": "0.103.19",
3
+ "version": "0.103.20",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "*"
7
7
  },
8
8
  "dependencies": {
9
- "@graphql-mesh/types": "^0.103.19",
10
- "@graphql-mesh/utils": "^0.103.19",
9
+ "@graphql-mesh/types": "^0.103.20",
10
+ "@graphql-mesh/utils": "^0.103.20",
11
11
  "@graphql-tools/utils": "^10.8.0",
12
+ "@whatwg-node/promise-helpers": "^1.0.0",
12
13
  "tslib": "^2.4.0"
13
14
  },
14
15
  "repository": {