File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/vue-apollo-composable/src Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,7 @@ export function useQueryImpl<
222222 let observer : ObservableSubscription | undefined
223223 let started = false
224224 let ignoreNextResult = false
225+ let firstStart = true
225226
226227 /**
227228 * Starts watching the query
@@ -257,7 +258,7 @@ export function useQueryImpl<
257258
258259 // Make the cache data available to the component immediately
259260 // This prevents SSR hydration mismatches
260- if ( ! isServer && ! currentOptions . value ?. keepPreviousResult && ( currentOptions . value ?. fetchPolicy !== 'no-cache' || currentOptions . value . notifyOnNetworkStatusChange ) ) {
261+ if ( ! isServer && ( firstStart || ! currentOptions . value ?. keepPreviousResult ) && ( currentOptions . value ?. fetchPolicy !== 'no-cache' || currentOptions . value . notifyOnNetworkStatusChange ) ) {
261262 const currentResult = query . value . getCurrentResult ( false )
262263
263264 if ( ! currentResult . loading || currentResult . partial || currentOptions . value ?. notifyOnNetworkStatusChange ) {
@@ -274,6 +275,8 @@ export function useQueryImpl<
274275 addSubscribeToMore ( item )
275276 }
276277 }
278+
279+ firstStart = false
277280 }
278281
279282 function startQuerySubscription ( ) {
You can’t perform that action at this time.
0 commit comments