File tree Expand file tree Collapse file tree 2 files changed +11
-19
lines changed
npm-packages/convex/src/react Expand file tree Collapse file tree 2 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -665,12 +665,6 @@ export type UseQueryOptions<Query extends FunctionReference<"query">> = {
665665 * @defaultValue undefined
666666 */
667667 initialValue ?: Query [ "_returnType" ] ;
668- /**
669- * When true, the query will not be subscribed and it will behave the same as
670- * if it was loading.
671- * @defaultValue false
672- */
673- skip ?: boolean ;
674668} & ( FunctionArgs < Query > extends EmptyObject
675669 ? {
676670 /**
@@ -703,12 +697,6 @@ export type UseQueryPreloadedOptions<Query extends FunctionReference<"query">> =
703697 * @defaultValue false
704698 */
705699 throwOnError ?: boolean ;
706- /**
707- * When true, the query will not be subscribed and it will behave the same as
708- * if it was loading.
709- * @defaultValue false
710- */
711- skip ?: boolean ;
712700 } ;
713701
714702/**
@@ -786,8 +774,7 @@ export function useQuery<Query extends FunctionReference<"query">>(
786774 typeof queryOrOptions === "object" &&
787775 queryOrOptions !== null &&
788776 ( "query" in queryOrOptions || "preloaded" in queryOrOptions ) ;
789- const isObjectSkip =
790- queryOrOptions === "skip" || ( isObjectOptions && ! ! queryOrOptions . skip ) ;
777+ const isObjectSkip = queryOrOptions === "skip" ;
791778 const isLegacy = ! isObjectOptions && ! isObjectSkip ;
792779 const legacySkip = isLegacy && args [ 0 ] === "skip" ;
793780 const isObjectReturn = isObjectOptions || isObjectSkip ;
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments