#Re execute query with React when parameter change

6 messages · Page 1 of 1 (latest)

charred hazel
#

Hi everyone,

I use useQuery with react to execute my query but one query's parameter depends from a select tag, How can I reexecute my query when the selected value change. I'm pretty sure I saw something to do that on discord or stack.convex, I didn't retrieve it.
Thank for your help

coral sinewBOT
#

Thanks for posting in #1088161997662724167.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.

  • Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
  • Use search.convex.dev to search Docs, Stack, and Discord all at once.
  • Additionally, you can post your questions in the Convex Community's #1228095053885476985 channel to receive a response from AI.
  • Avoid tagging staff unless specifically instructed.

Thank you!

restive bramble
#

The default behavior of useQuery is that it will re-execute when the parameters change, or the underlying data changes. So this happens by default. If you want to hold onto a cache of previous values so switching between tags doesn't re-fetch each time, you can check out https://stack.convex.dev/magic-caching

With Convex's magic query cache, Convex's powerful subscriptions are cached, not merely values. So you get fast, jank-free renders with no cache consi...

charred hazel
charred hazel
#

Is it normal usePaginatedQuery not re execute the pagination query when a parameter change ? Thank you

restive bramble