Skip to content

Commit 4ea93d5

Browse files
committed
drop skip object arg
1 parent 56bb898 commit 4ea93d5

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

npm-packages/convex/src/react/client.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -824,12 +824,6 @@ export type UseQueryOptions<Query extends FunctionReference<"query">> = {
824824
* @defaultValue undefined
825825
*/
826826
initialValue?: Query["_returnType"];
827-
/**
828-
* When true, the query will not be subscribed and it will behave the same as
829-
* if it was loading.
830-
* @defaultValue false
831-
*/
832-
skip?: boolean;
833827
} & (FunctionArgs<Query> extends EmptyObject
834828
? {
835829
/**
@@ -862,12 +856,6 @@ export type UseQueryPreloadedOptions<Query extends FunctionReference<"query">> =
862856
* @defaultValue false
863857
*/
864858
throwOnError?: boolean;
865-
/**
866-
* When true, the query will not be subscribed and it will behave the same as
867-
* if it was loading.
868-
* @defaultValue false
869-
*/
870-
skip?: boolean;
871859
};
872860

873861
/**
@@ -945,8 +933,7 @@ export function useQuery<Query extends FunctionReference<"query">>(
945933
typeof queryOrOptions === "object" &&
946934
queryOrOptions !== null &&
947935
("query" in queryOrOptions || "preloaded" in queryOrOptions);
948-
const isObjectSkip =
949-
queryOrOptions === "skip" || (isObjectOptions && !!queryOrOptions.skip);
936+
const isObjectSkip = queryOrOptions === "skip";
950937
const isLegacy = !isObjectOptions && !isObjectSkip;
951938
const legacySkip = isLegacy && args[0] === "skip";
952939
const isObjectReturn = isObjectOptions || isObjectSkip;

npm-packages/convex/src/react/use_query.test.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,16 @@ describe("useQuery types", () => {
9797
throwOnError: true,
9898
});
9999

100-
useQuery({
101-
query: api.module.args,
102-
args: { _arg: "asdf" },
103-
skip: true,
104-
});
100+
const _arg: string | undefined = undefined;
101+
102+
useQuery(
103+
!_arg
104+
? "skip"
105+
: {
106+
query: api.module.args,
107+
args: { _arg },
108+
},
109+
);
105110

106111
const {
107112
status: _status,

0 commit comments

Comments
 (0)