Skip to content

check if query or mutation is happening #120

Answered by posva
brenoliradev asked this question in Questions
Discussion options

You must be logged in to vote

FYI filters are supported. The queryCache is still not properly documented, so only the API is there. Relying on autocompletion helps but eventually the docs will be there.

For queries, you can do

const isLoading = computed(() => queryCache.getEntries({ predicate: (entry) => entry.asyncStatus.value === 'loading' }))

For mutations, this is not yet possible until the mutation store (#17) is exposed. Once exposed, they will have similar methods.

When it comes to invalidations, check the docs guide on this. On the future it would be possible to pass a global onSettled option for mutations to invalidate everything (although I would highly advise against it).

If the purpose of these APIs are gl…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@brenoliradev
Comment options

Answer selected by brenoliradev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #119 on November 27, 2024 13:23.