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