* fix(types): useQueries can not infer type of TError
* test(useQueries): infer TError from throwOnError
* types(queries): support to infer TError for queries of all frameworks
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* refactor: only pass query to refetchInterval function
this streamlines it with other functions, and avoids typing issues as it previously took transformed data from `select`
* test: adapt test because we don't have the types limitation anymore
* docs: refetchInterval
* feat(vue-query): `useBaseQuery` accepts `enabled` as a getter function
* feat(vue-query): `useQueries` accepts `enabled` as a getter function
---------
Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com>
* feat: tag the queryKey returned from queryOptions so that it knows about types of the queryFn
* feat: overloads for getQueryData / setQueryData
to infer types from queryOptions
* test: type-tests for queryClient to avoid regressions
* refactor: rename
* refactor(types): simplify options
interestingly, this also solves other types issues we had 🤯
* test: more tests for queryOptions
* fix(types): fetchInfiniteQuery should work when getNextPageParam is passed even if pages isn't
* feat(types): infiniteQueryOptions
* test: this should work
* fix(types): fix typing for setQueryData when only a value is passed
by making sure TS doesn't infer types from there
also, move from overloads to conditional return types
* refactor: re-use Updater type
* chore: fix tests
* chore: do an actual assertion
* refactor: remove ValidateQueryOptions
as it's not used anymore
* docs: queryOptions
* docs(typo): fix typo in word "semi-colon"
remove hyphen from word. Now "semicolon"
* docs(typo): fix grammar error
Replace "it's" with "its"
* docs(typo): fix grammar error
Replace "along side" with "alongside"
* docs(typo): fix spelling error
Replace "fallback" with "fall back". Fallback can only be used as a noun
* feat: allow editing string field values
* feat: make arrays clearable
* feat: add clear list icon
* feat: allow editing number values
* feat: make array items deletable
* chore: use ClearArray button component
* chore: clean up code
* test: add test for deletion
* chore: inline prop types
* chore: make dataPath optional
* chore: clean up button props
* test: use inline snapshots for data checks
* feat: use setQueryData for setting newData
* feat: use ts-expect-error
* feat: make more data types deletable
* feat: allow editing in Maps and Sets
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* feat: add stable-query-client rule
This commit introduces a new rule in the eslint-plugin-query package. The rule, named 'stable-query-client', ensures that the QueryClient is
stable. It checks if the QueryClient is either extracted from the component or wrapped in React.useState. If not, it suggests a fix to wrap
the QueryClient instantiation in a React.useState call. This rule is recommended to be set as an error.
* update recommended snapshot
* fix eslint
* check only immediate instantiation
* fix: allow QueryClient invocation in react server components
Updated the stable-query-client rule to allow the invocation of QueryClient inside react server components.
* docs: stable-query-client
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* docs(useQuery): explain identity function for placeholderData
clarify the usage of an identity function when used with placeholderData
* docs(useQuery): remove the word exported
remove the word exported regarding keepPreviousData