Skip to content

Can i update query keys from inside useQuery function #6695

Closed Answered by TkDodo
naveenSuki asked this question in General
Discussion options

You must be logged in to vote

So, one way I'm seeing is to fire one query without refechInterval to just get the initial ids for notes, then do multiple useQuery (one for each noteId), potentially in useQueries, and give each one their own refetchInterval and stop polling once this specific note is done.

This will make more requests one per noteId - batching them together would need to happen on a different layer, e.g. with a lib like batshit.

and if status of that note says; suggestions are generated; i want to stop polling for that note

But I'm also questioning a bit the approach in general. Let's assume you have 5 noteIds, and you get back status processing for all of them. You refetch in an interval, next time, …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@naveenSuki
Comment options

@TkDodo
Comment options

@naveenSuki
Comment options

@TkDodo
Comment options

Answer selected by naveenSuki
@naveenSuki
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants