mirror of
https://github.com/vuejs/apollo.git
synced 2026-02-01 14:37:18 +00:00
feat(useQuery): networkStatus
This commit is contained in:
parent
e1a7887fda
commit
e57eb7d073
@ -51,6 +51,7 @@ export function useQuery<
|
||||
*/
|
||||
const loading = ref(false)
|
||||
// trackQuery(loading)
|
||||
const networkStatus = ref<number>()
|
||||
|
||||
// Apollo Client
|
||||
const { resolveClient } = useApolloClient()
|
||||
@ -90,6 +91,7 @@ export function useQuery<
|
||||
function onNextResult (queryResult: ApolloQueryResult<TResult>) {
|
||||
result.value = queryResult.data
|
||||
loading.value = queryResult.loading
|
||||
networkStatus.value = queryResult.networkStatus
|
||||
}
|
||||
|
||||
function onError (queryError: any) {
|
||||
@ -243,6 +245,7 @@ export function useQuery<
|
||||
return {
|
||||
result,
|
||||
loading,
|
||||
networkStatus,
|
||||
error,
|
||||
// @TODO doesn't fully work yet
|
||||
// enabled,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user