File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/vue-apollo-composable/src Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11import {
22 ref ,
33 Ref ,
4+ unref ,
45 isRef ,
56 computed ,
67 watch ,
@@ -360,7 +361,7 @@ export function useQueryImpl<
360361 function updateRestartFn ( ) {
361362 // On server, will be called before currentOptions is initialized
362363 // @TODO investigate
363- if ( ! currentOptions ) {
364+ if ( ! currentOptions . value ) {
364365 debouncedRestart = baseRestart
365366 } else {
366367 if ( currentOptions . value ?. throttle ) {
@@ -404,7 +405,7 @@ export function useQueryImpl<
404405 } )
405406
406407 // Applying options
407- watch ( ( ) => isRef ( optionsRef ) ? optionsRef . value : optionsRef , value => {
408+ watch ( ( ) => unref ( optionsRef ) , value => {
408409 if ( currentOptions . value && (
409410 currentOptions . value . throttle !== value . throttle ||
410411 currentOptions . value . debounce !== value . debounce
@@ -418,14 +419,15 @@ export function useQueryImpl<
418419 immediate : true ,
419420 } )
420421
421- // Fefetch
422+ // Refetch
422423
423424 function refetch ( variables : TVariables | undefined = undefined ) {
424425 if ( query . value ) {
425426 if ( variables ) {
426427 currentVariables = variables
427428 }
428429 error . value = null
430+ loading . value = true
429431 return query . value . refetch ( variables )
430432 }
431433 }
You can’t perform that action at this time.
0 commit comments