@sanity/client 6.4.6 → 6.4.7

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/dist/index.cjs CHANGED
@@ -8,7 +8,7 @@ var getIt = require('get-it');
8
8
  var rxjs = require('rxjs');
9
9
  var operators = require('rxjs/operators');
10
10
  var name = "@sanity/client";
11
- var version = "6.4.6";
11
+ var version = "6.4.7";
12
12
  const middleware = [middleware$1.debug({
13
13
  verbose: true,
14
14
  namespace: "sanity:client"
@@ -886,7 +886,12 @@ function _fetch(client, httpRequest, query, params) {
886
886
  cache,
887
887
  next,
888
888
  ...opts
889
- } = options;
889
+ } = {
890
+ // Opt out of setting a `signal` on an internal `fetch` if one isn't provided.
891
+ // This is necessary in React Server Components to avoid opting out of Request Memoization.
892
+ useAbortSignal: typeof options.signal !== "undefined",
893
+ ...options
894
+ };
890
895
  const reqOpts = typeof cache !== "undefined" || typeof next !== "undefined" ? {
891
896
  ...opts,
892
897
  fetch: {
@@ -982,7 +987,8 @@ function _dataRequest(client, httpRequest, endpoint, body) {
982
987
  resultSourceMap: options.resultSourceMap,
983
988
  canUseCdn: isQuery,
984
989
  signal: options.signal,
985
- fetch: options.fetch
990
+ fetch: options.fetch,
991
+ useAbortSignal: options.useAbortSignal
986
992
  };
987
993
  return _requestObservable(client, httpRequest, reqOptions).pipe(operators.filter(isResponse), operators.map(getBody), operators.map(res => {
988
994
  if (!isMutation) {