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<
222
222
let observer : ObservableSubscription | undefined
223
223
let started = false
224
224
let ignoreNextResult = false
225
+ let firstStart = true
225
226
226
227
/**
227
228
* Starts watching the query
@@ -257,7 +258,7 @@ export function useQueryImpl<
257
258
258
259
// Make the cache data available to the component immediately
259
260
// 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 ) ) {
261
262
const currentResult = query . value . getCurrentResult ( false )
262
263
263
264
if ( ! currentResult . loading || currentResult . partial || currentOptions . value ?. notifyOnNetworkStatusChange ) {
@@ -274,6 +275,8 @@ export function useQueryImpl<
274
275
addSubscribeToMore ( item )
275
276
}
276
277
}
278
+
279
+ firstStart = false
277
280
}
278
281
279
282
function startQuerySubscription ( ) {
You can’t perform that action at this time.
0 commit comments