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

5,168 commits

Author SHA1 Message Date
Justin
7597c1fbfa
New MutationResultPair type (#663) 2020-07-03 01:38:03 +02:00
Jen Gettings
04a1346e89
fix(types): queryCache.getQueries (#688)
* fix(types): queryCache.getQueries

* fix(formatting)

* fix(types): queryCache parameters

* fix(formatting)

* fix(formatting)

Co-authored-by: Jen Gettings <jgettings@campuslabs.com>
2020-07-03 01:37:51 +02:00
Anthony D'Addeo
989c4cd310
Update global suspense configuration in example (#694) 2020-07-02 12:08:20 -06:00
Domino987
6e6ccfc480
fix: Enable partial makeQueryCache configs (#693) v2.4.11 2020-07-02 08:20:51 -06:00
Jeremy Liberman
406524d552
Fix fetch abort example (#690)
Passing controller.abort directly as a callback breaks the `this` context of the function.
2020-07-01 18:38:32 -06:00
Tanner Linsley
0b50b7564d fix: revert commit v2.4.10 2020-07-01 16:47:14 -06:00
Tanner Linsley
e167e8b5fa fix: queries without a query key are not added to cache 2020-07-01 16:44:21 -06:00
Tanner Linsley
cecf521bc0 fix: allow empty query key (with config enabled) v2.4.9 2020-07-01 14:07:33 -06:00
Tanner Linsley
cee6175ee2 tests: fix suspense test 2020-07-01 08:44:00 -06:00
Tanner Linsley
639dd9bc1f Merge branch 'master' of https://github.com/tannerlinsley/react-query 2020-07-01 08:36:02 -06:00
Tanner Linsley
4227830753 chore: workflow changes 2020-07-01 08:35:56 -06:00
Tanner Linsley
4bbf888fac
Update README.md
Fixes #683
2020-07-01 08:24:29 -06:00
Tanner Linsley
ef1d0d512f Merge branch 'master' of https://github.com/tannerlinsley/react-query v2.4.8 2020-06-30 20:05:21 -06:00
Tanner Linsley
229d16edab tests: ensure cache clearing does not notify in tests 2020-06-30 20:05:18 -06:00
Tanner Linsley
1eed839cfb fix: remove query calls notify 2020-06-30 20:04:51 -06:00
Denis Borovikov
15936ac040
Update README.md (#678)
See https://github.com/tannerlinsley/react-query/issues/664
2020-06-30 14:46:50 -06:00
Tanner Linsley
f5786b1637
fix: remove scarf v2.4.7 2020-06-30 13:46:58 -06:00
Tanner Linsley
dadfa17107
Update README.md 2020-06-30 13:45:16 -06:00
allcontributors[bot]
a40f44eb01
docs: Add @jelteliekens as a contributor (#675)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-06-30 13:39:35 +02:00
Jelte Liekens
0839ac8ff0
fix(types): fix MutateFunction (#674)
TVariables now extends undefined to determine the return type of MutateFunction.
2020-06-30 13:38:50 +02:00
allcontributors[bot]
bd0a6bb994
docs: Add @dpyzo0o as a contributor (#672)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-06-30 12:31:47 +02:00
dpyzo0o
a846524d6a
fix(types): Add missing type definition for queryFnParamsFilter (#671) v2.4.6 2020-06-30 12:26:53 +02:00
Michaël De Boey
2032924fbf
Update config.yml 2020-06-30 01:55:22 +02:00
Michaël De Boey
e4efc39939
Use funding key in package.json instead of postinstall script (#666)
* Delete postinstall.js

* Update package.json
2020-06-29 17:30:17 -06:00
Michaël De Boey
4cdcd18fce
Update FUNDING.yml (#665) 2020-06-29 17:05:54 -06:00
Edgardo Di Gesto
63c32ec4ec
Update README.md (#660) v2.4.5 2020-06-29 09:39:59 -06:00
Vladislav Shkodin
b3e4dda9fd
fix(types): Default Error type for setQueryData function (#659) 2020-06-29 09:39:13 -06:00
Cory House
8a3752f73c
docs: Fix bad link and typo (#658) 2020-06-29 09:38:25 -06:00
Jelte Liekens
bb3535d0ea
fix(types): improve v2 types (#655)
* fix(types): add variables argument to onError and onSettled and add generic TSnapshot

* refactor(types); add generic result type in BaseQueryOptions
2020-06-29 09:37:41 -06:00
allcontributors[bot]
1c51a8b8fc
docs: add bugzpodder as a contributor (#653)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-06-29 02:59:46 -06:00
Kevin Sullivan
7527457174
fix(types): v2 (#626) v2.4.4
* enable types, update simpleQuery

* update MutationState

* stricter query type

Co-authored-by: Michaël De Boey <info@michaeldeboey.be>

* verify imports

* verify import 2

* update fetchMore

* move ready condition to enabled

* update MutateOptions

* update config

* fix QueryResulltBase

* remove queryKey function

* remove duplicate type

* update prefetch

* functions are not valid queryKeys

* add option to queryFn, formatting

* Add dtslinting to ci test

* remove deprecated variables

* add types to formatting

* add resetErrorBoundaries

Co-authored-by: Michaël De Boey <info@michaeldeboey.be>
2020-06-28 18:01:27 -06:00
Tanner Linsley
fd9c8a1b81 refactor: break out query and queryInstance into their own files 2020-06-28 17:10:49 -06:00
Tanner Linsley
5057043dfc docs: comments on noop promise 2020-06-28 14:40:54 -06:00
Kevin Sullivan
ac11bdca0e
style: prettier formatting (#647)
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
2020-06-28 14:27:01 -06:00
Tanner Linsley
54d549ec4c Update test-and-publish.yml 2020-06-28 13:46:02 -06:00
Tanner Linsley
ae9c1101ef Update test-and-publish.yml 2020-06-28 10:21:13 -06:00
Tanner Linsley
50329b39a1 fix(invalidateQueries): respect enabled flag v2.4.3
Fixes #648
2020-06-28 10:16:06 -06:00
Fran Guijarro
fa42ae98ab
fix(setQueryData). When there is no previous instance of the query it tries to create a new one but the type signature was incorrect (#644) 2020-06-27 21:33:12 -06:00
Bishwendu Kundu
db5a51e087
fix(query-cache): Prevent re-run of query for refetch interval if update is disabled (#640) v2.4.2
* fix(query-cache): Prevent re-run of query based on refetch interval if update is disabled

* Update src/core/queryCache.js

Co-authored-by: Bishwendu Kundu <bishwendu.kundu@broadcom.com>
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>

Fixes #635
2020-06-26 23:56:00 -06:00
Jack Zhao
53e8424041
fix: disabling query in suspense mode (#643) 2020-06-26 23:48:21 -06:00
Tanner Linsley
ac2a21f730 Merge branch 'master' of https://github.com/tannerlinsley/react-query 2020-06-26 23:27:53 -06:00
Tanner Linsley
7cd1af1b47 refactor: Move infinite query logic into queryCache 2020-06-26 23:27:51 -06:00
Will Tanna
dbef0382f5
tests: Add callback tests for useMutation (#641)
Adds callback tests for when the `mutate` function is called multiple
times in a row.
2020-06-26 21:57:30 -06:00
Tanner Linsley
5a5ad749e7 fix(useMutation): ensure all side-effects are always called v2.4.1
Fixes #249

Now all we need is the new test from #641
2020-06-26 19:19:51 -06:00
Tanner Linsley
2de852896b chore: Reorganize code to core + react 2020-06-26 10:03:45 -06:00
0xflotus
bcecb5476e
(docs): fixed small errors (#636) 2020-06-25 13:25:10 -06:00
Tanner Linsley
ce25ffa5da Update README.md 2020-06-25 10:45:30 -06:00
Tanner Linsley
d7048d1c35 feat: add initialStale option to queries v2.4.0
By default `initialData` is not considered stale, but sometimes you may want it to be, for instance, if your initial data is only a partial subset of an object and you know you will need to refetch the full version immediately after mounting. For this, you can use the `initialStale: true` options.

By setting `initialStale` to `true`, the `initialData` will be considered `stale` and will cause a refetch when the query mounts for the first time.

```js
function Todos() {
  const queryInfo = useQuery('todos', () => fetch('/todos'), {
    initialData: todoListPreview,
    initialStale: true,
  })
}
```
2020-06-25 10:38:50 -06:00
Tanner Linsley
8ec83f43fa Merge branch 'master' of https://github.com/tannerlinsley/react-query v2.3.0 2020-06-25 09:47:21 -06:00
Tanner Linsley
9a734f617d feat: add refetchInactive option to invalidateQueries
Normally, inactive queries do not refetch when they are invalidated, but you can now use the `refetchInactive: true` option to force them to refetch.
2020-06-25 09:47:19 -06:00