@@ -201,10 +201,6 @@ export declare namespace useQuery {
201201 export type ResultForOptions <
202202 TData ,
203203 TVariables extends OperationVariables ,
204- TOptions extends
205- | Record < string , never > // no options
206- | Options < TData , TVariables >
207- | SkipToken ,
208204 TReturnPartialData extends boolean | undefined = undefined ,
209205 > = LazyType <
210206 Result <
@@ -213,16 +209,13 @@ export declare namespace useQuery {
213209 | "complete"
214210 | "streaming"
215211 | "empty"
216- | ( TOptions extends any ?
217- TOptions extends SkipToken ? never
218- : OptionWithFallback <
219- { returnPartialData : TReturnPartialData } ,
220- DefaultOptions ,
221- "returnPartialData"
222- > extends false ?
223- never
224- : "partial"
225- : never )
212+ | ( OptionWithFallback <
213+ { returnPartialData : TReturnPartialData } ,
214+ DefaultOptions ,
215+ "returnPartialData"
216+ > extends false ?
217+ never
218+ : "partial" )
226219 >
227220 > ;
228221
@@ -532,22 +525,16 @@ export declare namespace useQuery {
532525 DocumentNode | TypedDocumentNode < TData , TVariables >
533526 : // this overload should only be accessible if all `TVariables` are optional
534527 never
535- ) : useQuery . ResultForOptions < TData , TVariables , Record < string , never > > ;
528+ ) : useQuery . ResultForOptions < TData , TVariables > ;
536529
537530 /** {@inheritDoc @apollo/client/react!useQuery.DocumentationTypes.useQuery:call(1) } */
538531 <
539532 TData ,
540533 TVariables extends OperationVariables ,
541534 // this overload should never be manually defined, it should always be inferred
542- TOptions extends useQuery . Options < TData , NoInfer < TVariables > > &
543- VariablesOption <
544- TVariables & {
545- [ K in Exclude <
546- keyof TOptions [ "variables" ] ,
547- keyof TVariables
548- > ] ?: never ;
549- }
550- > ,
535+ TProvidedVariables extends TVariables & {
536+ [ K in Exclude < keyof TProvidedVariables , keyof TVariables > ] ?: never ;
537+ } = TVariables ,
551538 TReturnPartialData extends boolean | undefined = undefined ,
552539 > (
553540 query : DocumentNode | TypedDocumentNode < TData , TVariables > ,
@@ -556,15 +543,20 @@ export declare namespace useQuery {
556543 [ TVariables ] extends [ never ] ? [ options : never ]
557544 : // variables optional
558545 { } extends TVariables ?
559- [ options ?: TOptions & { returnPartialData ?: TReturnPartialData } ]
546+ [
547+ options ?: useQuery . Base . Options < TData , NoInfer < TVariables > > & {
548+ variables ?: TProvidedVariables ;
549+ returnPartialData ?: TReturnPartialData ;
550+ } ,
551+ ]
560552 : // variables required
561- [ options : TOptions & { returnPartialData ?: TReturnPartialData } ]
562- ) : useQuery . ResultForOptions <
563- TData ,
564- TVariables ,
565- TOptions ,
566- TReturnPartialData
567- > ;
553+ [
554+ options : useQuery . Base . Options < TData , NoInfer < TVariables > > & {
555+ variables : TProvidedVariables ;
556+ returnPartialData ?: TReturnPartialData ;
557+ } ,
558+ ]
559+ ) : useQuery . ResultForOptions < TData , TVariables , TReturnPartialData > ;
568560
569561 /** {@inheritDoc @apollo/client/react!useQuery.DocumentationTypes.useQuery:call(1) } */
570562 <
@@ -582,15 +574,9 @@ export declare namespace useQuery {
582574 TData ,
583575 TVariables extends OperationVariables ,
584576 // this overload should never be manually defined, it should always be inferred
585- TOptions extends useQuery . Options < TData , NoInfer < TVariables > > &
586- VariablesOption <
587- TVariables & {
588- [ K in Exclude <
589- keyof TOptions [ "variables" ] ,
590- keyof TVariables
591- > ] ?: never ;
592- }
593- > ,
577+ TProvidedVariables extends TVariables & {
578+ [ K in Exclude < keyof TProvidedVariables , keyof TVariables > ] ?: never ;
579+ } = TVariables ,
594580 TReturnPartialData extends boolean | undefined = undefined ,
595581 > (
596582 query : DocumentNode | TypedDocumentNode < TData , TVariables > ,
@@ -601,21 +587,22 @@ export declare namespace useQuery {
601587 { } extends TVariables ?
602588 [
603589 options ?:
604- | ( TOptions & { returnPartialData ?: TReturnPartialData } )
590+ | ( useQuery . Base . Options < TData , NoInfer < TVariables > > & {
591+ variables ?: TProvidedVariables ;
592+ returnPartialData ?: TReturnPartialData ;
593+ } )
605594 | SkipToken ,
606595 ]
607596 : // variables required
608597 [
609598 options :
610- | ( TOptions & { returnPartialData ?: TReturnPartialData } )
599+ | ( useQuery . Base . Options < TData , NoInfer < TVariables > > & {
600+ variables : TProvidedVariables ;
601+ returnPartialData ?: TReturnPartialData ;
602+ } )
611603 | SkipToken ,
612604 ]
613- ) : useQuery . ResultForOptions <
614- TData ,
615- TVariables ,
616- TOptions | SkipToken ,
617- TReturnPartialData
618- > ;
605+ ) : useQuery . ResultForOptions < TData , TVariables , TReturnPartialData > ;
619606
620607 ssrDisabledResult : ObservableQuery . Result < any > ;
621608 }
0 commit comments