v1.2.0
What's Changed
- Add a distinguishing factor between infinite query keys and regular query keys by @paul-sachs in #334
- Add support for enabled to useInfiniteQuery by @paul-sachs in #338
Changes to infinite query keys
With #334, we're fixing a bug where the cache of a regular query collides with the cache of an infinite query, which can lead to type mismatches and unexpected failures if you use the same RPC with an infinite query and a regular query.
We are now using a separate query key for infinite queries to solve the issue (we append "infinite" to the key), but this change can potentially affect you:
If you tried to invalidate some infinite queries like queryClient.invalidateQueries({ queryKey: createConnectQueryKey(...), exact: true })
, this now only invalidates queries initialized with useQuery
. To invalidate infinite queries, you can either set exact
to false, or use createConnectInfiniteQueryKey()
instead. Also note that this change not only affects invalidateQueries
but any operations against the queryClient that interact with the cache using a key (eg, queryClient.setQueriesData, etc.)
Full Changelog: v1.1.3...v1.2.0