File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
packages/vue-apollo-composable/src Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -236,20 +236,26 @@ export function useQuery<
236236 }
237237
238238 let debouncedRestart : Function
239+ let isRestartDebounceSetup = false
239240 function updateRestartFn ( ) {
241+ // On server, will be called before currentOptions is initialized
242+ // @TODO investigate
240243 if ( ! currentOptions ) {
241244 debouncedRestart = baseRestart
242- } else if ( currentOptions . value . throttle ) {
243- debouncedRestart = throttle ( currentOptions . value . throttle , baseRestart )
244- } else if ( currentOptions . value . debounce ) {
245- debouncedRestart = debounce ( currentOptions . value . debounce , baseRestart )
246245 } else {
247- debouncedRestart = baseRestart
246+ if ( currentOptions . value . throttle ) {
247+ debouncedRestart = throttle ( currentOptions . value . throttle , baseRestart )
248+ } else if ( currentOptions . value . debounce ) {
249+ debouncedRestart = debounce ( currentOptions . value . debounce , baseRestart )
250+ } else {
251+ debouncedRestart = baseRestart
252+ }
253+ isRestartDebounceSetup = true
248254 }
249255 }
250256
251257 function restart ( ) {
252- if ( ! debouncedRestart ) updateRestartFn ( )
258+ if ( ! isRestartDebounceSetup ) updateRestartFn ( )
253259 debouncedRestart ( )
254260 }
255261
You can’t perform that action at this time.
0 commit comments