TanStackT
TanStack15mo ago
4 replies
spotty-amber

Is it possible to set default queryKey for all queries?

Hello)

Has anyone ever needed to set a default
queryKey
that applies to all queries? In my project, I send the user's language with most queries to receive translations based on it. I want to refetch the query whenever the user changes the app language.

Of course, I could add the language as a
queryKey
for each individual query, but is there a way to set this as a default for all queries?

Thanks!
Was this page helpful?