We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent deef3fe commit 4070c42Copy full SHA for 4070c42
packages/swr-openapi/src/query-base.ts
@@ -4,7 +4,7 @@ import type { Fetcher, SWRHook } from "swr";
4
import type { TypesForGetRequest } from "./types.js";
5
import { useCallback, useDebugValue, useMemo } from "react";
6
7
-export const RESPONSE = Symbol.for('response');
+export const RESPONSE = Symbol.for("response");
8
9
/**
10
* @private
@@ -43,7 +43,7 @@ export function configureBaseQueryHook(useHook: SWRHook) {
43
});
44
throw res.error;
45
}
46
- if (res.data) {
+ if (res.data && typeof res.data === "object") {
47
Object.defineProperty(res.data, RESPONSE, {
48
value: res.response,
49
enumerable: false,
0 commit comments