mirror of
https://github.com/vuejs/apollo.git
synced 2026-02-01 14:37:18 +00:00
feat(useQuery): refetch
This commit is contained in:
parent
bfb5d08c69
commit
e77518adba
@ -162,6 +162,17 @@ export function useQuery<
|
||||
deep: true,
|
||||
})
|
||||
|
||||
// Fefetch
|
||||
|
||||
function refetch (variables: TVariables = null) {
|
||||
if (query.value) {
|
||||
if (variables) {
|
||||
currentVariables = variables
|
||||
}
|
||||
return query.value.refetch(variables)
|
||||
}
|
||||
}
|
||||
|
||||
// Subscribe to more
|
||||
|
||||
const subscribeToMoreItems: SubscribeToMoreItem[] = []
|
||||
@ -242,6 +253,7 @@ export function useQuery<
|
||||
variables: variablesRef,
|
||||
options: optionsRef,
|
||||
query,
|
||||
refetch,
|
||||
subscribeToMore,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user