@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.js CHANGED
@@ -4,7 +4,7 @@ export { adapter as unstable__adapter, environment as unstable__environment } fr
4
4
  import { Observable, lastValueFrom } from 'rxjs';
5
5
  import { map, filter } from 'rxjs/operators';
6
6
  var name = "@sanity/client";
7
- var version = "6.4.6";
7
+ var version = "6.4.7";
8
8
  const middleware = [debug({
9
9
  verbose: true,
10
10
  namespace: "sanity:client"
@@ -882,7 +882,12 @@ function _fetch(client, httpRequest, query, params) {
882
882
  cache,
883
883
  next,
884
884
  ...opts
885
- } = options;
885
+ } = {
886
+ // Opt out of setting a `signal` on an internal `fetch` if one isn't provided.
887
+ // This is necessary in React Server Components to avoid opting out of Request Memoization.
888
+ useAbortSignal: typeof options.signal !== "undefined",
889
+ ...options
890
+ };
886
891
  const reqOpts = typeof cache !== "undefined" || typeof next !== "undefined" ? {
887
892
  ...opts,
888
893
  fetch: {
@@ -978,7 +983,8 @@ function _dataRequest(client, httpRequest, endpoint, body) {
978
983
  resultSourceMap: options.resultSourceMap,
979
984
  canUseCdn: isQuery,
980
985
  signal: options.signal,
981
- fetch: options.fetch
986
+ fetch: options.fetch,
987
+ useAbortSignal: options.useAbortSignal
982
988
  };
983
989
  return _requestObservable(client, httpRequest, reqOptions).pipe(filter(isResponse), map(getBody), map(res => {
984
990
  if (!isMutation) {