@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.
@@ -862,7 +862,12 @@ function _fetch(client, httpRequest, query, params) {
862
862
  cache,
863
863
  next,
864
864
  ...opts
865
- } = options;
865
+ } = {
866
+ // Opt out of setting a `signal` on an internal `fetch` if one isn't provided.
867
+ // This is necessary in React Server Components to avoid opting out of Request Memoization.
868
+ useAbortSignal: typeof options.signal !== "undefined",
869
+ ...options
870
+ };
866
871
  const reqOpts = typeof cache !== "undefined" || typeof next !== "undefined" ? {
867
872
  ...opts,
868
873
  fetch: {
@@ -958,7 +963,8 @@ function _dataRequest(client, httpRequest, endpoint, body) {
958
963
  resultSourceMap: options.resultSourceMap,
959
964
  canUseCdn: isQuery,
960
965
  signal: options.signal,
961
- fetch: options.fetch
966
+ fetch: options.fetch,
967
+ useAbortSignal: options.useAbortSignal
962
968
  };
963
969
  return _requestObservable(client, httpRequest, reqOptions).pipe(filter(isResponse), map(getBody), map(res => {
964
970
  if (!isMutation) {