@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.browser.cjs +8 -2
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +8 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/package.json +14 -14
- package/src/data/dataMethods.ts +7 -1
- package/umd/sanityClient.js +16 -5
- package/umd/sanityClient.min.js +3 -3
package/dist/index.browser.js
CHANGED
|
@@ -862,7 +862,12 @@ function _fetch(client, httpRequest, query, params) {
|
|
|
862
862
|
cache,
|
|
863
863
|
next,
|
|
864
864
|
...opts
|
|
865
|
-
} =
|
|
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) {
|