0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
Commit graph

5,165 commits

Author SHA1 Message Date
Dominik Dorfmeister
09116e54b9
feat(queryClient): add setQueriesData utility (#2204)
* feat(queryClient): add setQueriesData utility

a function which can be used to fuzzily set queryData for multiple queries

* feat(queryClient): add setQueriesData utility

docs

* feat(queryClient): add setQueriesData utility

improve docs

* feat(queryClient): add setQueriesData utility

wrap setQueriesData in notifyManager.batch to avoid unnecessary re-renders
2021-05-07 10:04:03 -06:00
Niek Bosch
c8b3ff2153
fix: do not throw errors while a query is retrying (#2147) v3.15.3 2021-05-07 09:54:47 -06:00
Dominik Dorfmeister
3b2c4088e1
feat(useQuery) transform placeholder data with select (#2108)
* feat(useQuery): run placeholderData through select

* feat(useQuery): run placeholderData through select

add a test for placeholderDataFunction

* feat(useQuery): run placeholderData through select

fix structural sharing, in the options, we might also have the placeholderData function, but on the previous result, we have the correct result from the previous iteration, which we want to keep if possible
2021-05-07 09:52:17 -06:00
Gornyy Vladimir
c932d00322
docs(useQuery): change isFetching default to false (#2071)
* docs(useQuery): change isFetching default to false

* Update docs/src/pages/reference/useQuery.md

Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
2021-05-07 09:51:26 -06:00
Guanghui Wang
25a0eb5e33
docs: Update initial-query-data.md (#2215) 2021-05-05 08:47:27 +02:00
Adebiyi Adedotun
8026f4badf
docs: (#2218)
* Fix typo in Mutations guide

* Update docs/src/pages/guides/mutations.md

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>

* Fix typo in Placeholder Query Data guide

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2021-05-04 22:38:23 +02:00
Dominik Dorfmeister
542ad07ca8
docs: update query-key docs (#2214) 2021-04-30 11:32:46 +02:00
Dominik Dorfmeister
4083c1ef8a
fix(useQuery): make sure queryKeys are always an array at runtime when passed to the queryFn (#2200) v3.15.2 2021-04-29 22:17:38 +02:00
Dominik Dorfmeister
9686426915
chore: add prettier to pipeline checks and include .ts files (#2205) 2021-04-29 21:54:57 +02:00
Adebiyi Adedotun
7d9c9f872f
docs: Fix typo in Mutations guide (#2210) 2021-04-29 21:15:32 +02:00
Guanghui Wang
2c559dbdf0
docs: Update placeholder-query-data.md (#2212) 2021-04-29 20:45:07 +02:00
Dominik Dorfmeister
2e03a615f8
fix(types): allow returning of any promise in the mutation callbacks (#2189) v3.15.1 2021-04-28 16:16:51 -06:00
Gabriel Bull
9626c1b732
feat(persist): Added hydrate and dehydrate options to the persistQueryClient function (#2131) v3.15.0 2021-04-28 19:47:46 +02:00
Damian Osipiuk
79ad5a9ccb
feat(query): add 'getObserversCount' util (#2130) v3.14.0
* feat(query): add 'getObserversCount' util

* refactor: replace usage of private observers with getter
2021-04-28 19:44:27 +02:00
Bennett
2e8f38c1ff
docs: Add curly brackets to mutation example for TS (#2193) 2021-04-25 21:24:55 +02:00
Arihant Verma
3a13b3e761
docs(Query Filters): Correct/Make More Exact: Query Filter Object Code Snippet Comments (#2190)
1. Make comment in the code snippet for `removeQueries` more exact
2. correct comment for `refetchQueries` used for `posts` query key, to use 'posts' instead of 'post'.
2021-04-25 20:38:49 +02:00
Dominik Dorfmeister
92435c77b8
fix(types): add mutationFn to UseMutationOptions (#2182) v3.13.12 2021-04-24 09:43:37 +02:00
Fabien Mauquié
07ce2a5732
fix: focus handler typings (#2152)
Typings did not allow passing a function taking `setFocused` to addEventListener

Fixing by using the same typings as in `onlineManager.ts`, same behavior as set in #2053
2021-04-24 09:43:04 +02:00
Michaël De Boey
e49afc04a7
chore: add tests for Node 16 (#2165) 2021-04-24 09:40:22 +02:00
Ian Schmitz
64dec9eb9b
docs: fix event pooling info (#2174)
* Fix React event pooling link

* Update mutations.md
2021-04-22 19:55:02 +02:00
Georges Sempéré
da85602025
docs: add some details to staleTime documentation (#2172) 2021-04-22 19:35:19 +02:00
Or Ouziel
5f7363518a
fix(types): use MutationKey in UseMutationOptions (#2164) v3.13.11 2021-04-21 17:31:39 +02:00
Suhas R. More
6fe0033e9c
docs: added quotes to improve rediability of line (#2153) 2021-04-21 14:48:25 +02:00
Jonathon Hawkins
f1c34ef679
docs: Highlighting change of the default config key. (#2155) 2021-04-20 20:26:35 +02:00
Alexander Kachkaev
c3434575a1
fix: Add TQueryKey to QueryFunction generic type in QueryOptions, remove ensureArray from Query (#2074) v3.13.10
* Add TQueryKey to QueryFunction generic type in QueryOptions

* Fix typing in souurce

* Fix inner typings, add test

* Avoid "as unknown" hack

* Remove ensureArray
2021-04-17 11:40:48 +02:00
Brandon Bayer
de28254159
fix: useInfiniteQuery suspense bug (#2119) v3.13.9
* fix useInfiniteQuery suspense bug

* real fix

* move fix to infiniteQueryObserver
2021-04-15 10:27:51 -06:00
Fredrik Höglund
2050773711
fix(hydration): import useQueryClient directly from react-query (#2121) v3.13.8 2021-04-14 13:03:02 +02:00
Ohans Emmanuel
90308e1f9e
docs(useQuery): add the useErrorBoundary option (#2084) 2021-04-14 07:33:20 +02:00
Dominik Dorfmeister
eac52f66d3
fix(devtools): import useQueryClient directly from react-query (#2113) v3.13.7 2021-04-13 22:11:43 +02:00
Jeroen van Aert
f899e55eca
docs: typo (#2118) 2021-04-13 22:09:41 +02:00
Damian Osipiuk
7fe6e30bc1
refactor(devtools): remove redundant isStale utility (#2111) 2021-04-12 11:35:12 +02:00
Hyuntae EOM
a88d80f6f7
fix(types): Add undefined return type in onMutate (#2089) v3.13.6
* onMutate callback add void in return type

* Add core type

* return type void to undefined

* onMutate return type change 'Promise<TContext> | Promise<undefined> | TContext | undefined'
2021-04-10 15:58:09 +02:00
Dominik Dorfmeister
d7d766e215
chore: fix test warnings (#2070)
* chore: fix eslint warnings by including refetch in the dependency array

the refetch function is stable

* chore: mockConsoleError for tests that expect errors to be thrown

to avoid error output on the console during tests
2021-04-10 15:56:48 +02:00
Ali Moallem
6ee897ce87
docs(useInfiniteQuery): Correction of two mistakes in the code sample (#2064) 2021-04-10 15:55:43 +02:00
Mihir Gupta
eb94ef3f4e
docs: fix minor typo (#2083) 2021-04-10 15:48:52 +02:00
Mitchel
2cb94ad467
docs: fix typo (#2082) 2021-04-10 15:48:14 +02:00
Diederik van den Burger
356627a336
fix(types): adds queryKey generic to queryClient functions (#2100) v3.13.5
* fix(types): adds queryKey generic to queryClient functions

* test(clientQuery): adds tests for type-errors when using strict keys
2021-04-08 14:07:58 +02:00
Luis Adame Rodríguez
e81cb478ad
docs(QueryStatus): change from enum to union type (#2073)
* docs: add query status typing change from enum to string literal

* docs: underline links in headings

as their color is inherited from the heading and links are
indistinguishable from the heading itself

* docs: move query status typing change to typescript section

* docs: underline level four heading links too

* docs: remove unnecessary old line from diff
2021-04-03 19:02:52 +02:00
Dominik Dorfmeister
7b14ef519a
fix(useQuery): type of initialData now corresponds to the type returned by the query-fn (#2069) v3.13.4 2021-04-02 08:57:07 +02:00
Dominik Dorfmeister
f000af174d
chore: codesandbox auto builds (#2062)
* chore: try out codesandbox auto builds

* commit something to trigger deployments

* chore: codesandbox auto builds

set node to v14 because: [!] TypeError: inputSrcs.map(...).flat is not a function

* chore: codesandbox auto builds

use the root directory for publishing, because it contains the package.json

* chore: codesandbox auto builds

let's see if codesandbox picks up the basic example with a leading slash like shown in the docs

* chore: codesandbox auto builds

revert the test commit

* chore: codesandbox auto builds

add basic-typescript example

* chore: codesandbox auto builds

add basic-typescript example to codesandbox builds

* chore: codesandbox auto builds

no-use-before-define

* chore: codesandbox auto builds

don't use exact versions for examples, otherwise, we won't have the latest version when trying them out
2021-03-31 14:20:39 -06:00
Dominik Dorfmeister
e42cbc32df
fix(useQuery): let type of queryKey for the QueryContext be inferred from the key passed to useQuery (#2047) v3.13.3
* fix(useQuery): let type of queryKey for the QueryContext be inferred from the key passed to useQuery

* fix(useInfiniteQuery): let type of queryKey for the QueryContext be inferred from the key passed to useInfiniteQuery

* fix(useQuery): pass TQueryKey down to queryObserver

for more type safety and to make queryKeyHashFn generic as well
2021-03-31 08:20:42 -06:00
Dominik Dorfmeister
9428bfdb7f
fix(types): onlineManager: setup function needs to accept the online boolean, and the cleanup function shouldn't (#2053) v3.13.2
* fix(types): setup function needs to accept the online boolean, and the cleanup function shouldn't

* fix(types): assign listener to a function so that we can properly unsubscribe
2021-03-30 11:41:52 -06:00
Dominik Dorfmeister
b19ad1f97a
fix(devtools): only subscribe to the queryCache while the devtools are open (#2045) v3.13.1
this will stop unnecessary and sometimes costly updates while they are closed
2021-03-30 11:36:01 -06:00
Dawid Kobierski
bd0d4de3c2
docs: Correct typo which could mislead someone (#1832) 2021-03-30 11:34:12 -06:00
Dominik Dorfmeister
fbaed6673f
fix(types): align prefetchQuery generics with fetchQuery types (#2016) 2021-03-30 11:32:49 -06:00
Justin Thareja
7cf74a4751
docs(examples/optimistic-updates): fix typo (#2044) 2021-03-28 22:13:45 +02:00
Vinay Deshmukh
ba86d6f67c
docs(useQuery): add doc for queryKeyHashFn (#2043) 2021-03-28 19:40:20 +02:00
Tanner Linsley
4dfcf8989f docs: fix carbonads 2021-03-26 16:17:30 -06:00
Tanner Linsley
9faeff240f docs: update footer styles 2021-03-26 15:49:06 -06:00
Tanner Linsley
cdb801f22c docs: carbonads 2021-03-26 15:43:23 -06:00