@graphql-mesh/plugin-deduplicate-request 0.1.21 → 1.0.0-alpha-20230420220344-25b6b92bf

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
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("@graphql-mesh/utils");
4
3
  function useDeduplicateRequest() {
5
4
  const reqResMapByContext = new WeakMap();
6
5
  function getReqResMapByContext(context) {
@@ -19,14 +18,10 @@ function useDeduplicateRequest() {
19
18
  method = options.method;
20
19
  }
21
20
  if (method === 'GET') {
22
- let headers = {};
23
- if (options.headers) {
24
- headers = (0, utils_1.getHeadersObj)(options.headers);
25
- }
26
21
  const reqResMap = getReqResMapByContext(context);
27
22
  const dedupCacheKey = JSON.stringify({
28
23
  url,
29
- headers,
24
+ headers: options.headers || {},
30
25
  });
31
26
  setFetchFn(() => {
32
27
  let dedupRes$ = reqResMap.get(dedupCacheKey);
package/esm/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import { getHeadersObj } from '@graphql-mesh/utils';
2
1
  export default function useDeduplicateRequest() {
3
2
  const reqResMapByContext = new WeakMap();
4
3
  function getReqResMapByContext(context) {
@@ -17,14 +16,10 @@ export default function useDeduplicateRequest() {
17
16
  method = options.method;
18
17
  }
19
18
  if (method === 'GET') {
20
- let headers = {};
21
- if (options.headers) {
22
- headers = getHeadersObj(options.headers);
23
- }
24
19
  const reqResMap = getReqResMapByContext(context);
25
20
  const dedupCacheKey = JSON.stringify({
26
21
  url,
27
- headers,
22
+ headers: options.headers || {},
28
23
  });
29
24
  setFetchFn(() => {
30
25
  let dedupRes$ = reqResMap.get(dedupCacheKey);
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@graphql-mesh/plugin-deduplicate-request",
3
- "version": "0.1.21",
3
+ "version": "1.0.0-alpha-20230420220344-25b6b92bf",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@graphql-mesh/types": "^0.91.12",
7
- "@graphql-mesh/utils": "^0.43.20",
6
+ "@graphql-mesh/types": "1.0.0-alpha-20230420220344-25b6b92bf",
7
+ "@graphql-mesh/utils": "1.0.0-alpha-20230420220344-25b6b92bf",
8
8
  "graphql": "*",
9
9
  "tslib": "^2.4.0"
10
10
  },