react-query-questions
solid-query-questions
table-questions
virtual-questions
router-questions
react-charts-questions
ranger-questions
vue-query-questions
svelte-query-questions
bling-questions
form-questions
angular-query-questions
start-questions
db-questions
start-showcase
router-showcase
📣-announcements
Pass a generic infiniteQueryOptions object as parameter
API call extremely slow in production but works fine in development
Combining debounced query with `isFetching`
Best way to fetch API data in Next.js with TanStack Query
orm interface for useQuery different hooks synchronization
Question about useSuspenseQuery
UseQuery loading spinner showing right away! :(
Setting state cache on success
How to pass query data to parent component in react?
usequery error typing
NextJS: Prefetching/Hydration overwriting fresher cache data when using streaming SSR with staleTime
`enabled: false` returning cached data
useQuery
and pass in a query object that depends on some data. If that data isn't available or isn't loaded yet, they'll set enabled: false
to disable the query. However, disabling a query only prevents the query from running, and it may still return cached data (see https://tanstack.com/query/latest/docs/framework/react/guides/disabling-queries). People then write the rest of the code expecting data to be undefined, but in prod that data will sometimes happen to be cached by some other part of the app and users will get all of that cached data instead of undefined and the UI will break or behave unexpectedly.
Our solution was to overwrite useQuery
to have the resulting data always be undefined if enabled is false since that's what people on our team expect to happen. Is there any downside to doing this?
I've attached our overwritten useQuery
with what I believe are the correct types (I copy-pasted most of the code from the useQuery
implementation). I don't love having to use useMemo
but it seemed preferable to updating data
directly on the returned object....Tracked properties mutation
useQuery
? Lets assume I am not using isPending from my useMutation, it seems like my component keeps rerendering?Invalidating queryKey with variable doesn't work
5.84.1
):
...Fragment masking with GraphQL code-gen does not work.
invalidating the first key doesn't work
["user"]
doesn't invalidate ["user", "some-username", "posts"]
? i'm sure that i'm using correctqueryClient
as well
// useQuery
const threadsQuery = useInfiniteQuery(userThreadsInfiniteOptions(username));
// useQuery
const threadsQuery = useInfiniteQuery(userThreadsInfiniteOptions(username));
Hiring a full stack developer
Upgrading to v5.59 causes crashes on sandboxed environment
Cache update