@refinedev/core 4.53.0 → 4.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +375 -0
- package/dist/components/pages/auth/components/login/index.d.cts.map +1 -1
- package/dist/components/pages/auth/components/login/index.d.ts.map +1 -1
- package/dist/contexts/data/types.d.cts +71 -0
- package/dist/contexts/data/types.d.cts.map +1 -1
- package/dist/contexts/data/types.d.mts +71 -0
- package/dist/contexts/data/types.d.mts.map +71 -0
- package/dist/contexts/data/types.d.ts +71 -0
- package/dist/contexts/data/types.d.ts.map +1 -1
- package/dist/definitions/types/index.d.cts +12 -0
- package/dist/definitions/types/index.d.cts.map +1 -0
- package/dist/definitions/types/index.d.mts +12 -0
- package/dist/definitions/types/index.d.mts.map +12 -0
- package/dist/definitions/types/index.d.ts +12 -0
- package/dist/definitions/types/index.d.ts.map +1 -0
- package/dist/hooks/data/useCreate.d.cts +7 -6
- package/dist/hooks/data/useCreate.d.cts.map +1 -1
- package/dist/hooks/data/useCreate.d.mts +7 -6
- package/dist/hooks/data/useCreate.d.mts.map +7 -6
- package/dist/hooks/data/useCreate.d.ts +7 -6
- package/dist/hooks/data/useCreate.d.ts.map +1 -1
- package/dist/hooks/data/useCreateMany.d.cts +9 -9
- package/dist/hooks/data/useCreateMany.d.cts.map +1 -1
- package/dist/hooks/data/useCreateMany.d.mts +9 -9
- package/dist/hooks/data/useCreateMany.d.mts.map +9 -9
- package/dist/hooks/data/useCreateMany.d.ts +9 -9
- package/dist/hooks/data/useCreateMany.d.ts.map +1 -1
- package/dist/hooks/data/useUpdate.d.cts +8 -7
- package/dist/hooks/data/useUpdate.d.cts.map +1 -1
- package/dist/hooks/data/useUpdate.d.mts +8 -7
- package/dist/hooks/data/useUpdate.d.mts.map +8 -7
- package/dist/hooks/data/useUpdate.d.ts +8 -7
- package/dist/hooks/data/useUpdate.d.ts.map +1 -1
- package/dist/hooks/data/useUpdateMany.d.cts +9 -9
- package/dist/hooks/data/useUpdateMany.d.cts.map +1 -1
- package/dist/hooks/data/useUpdateMany.d.mts +9 -9
- package/dist/hooks/data/useUpdateMany.d.mts.map +9 -9
- package/dist/hooks/data/useUpdateMany.d.ts +9 -9
- package/dist/hooks/data/useUpdateMany.d.ts.map +1 -1
- package/dist/hooks/form/index.d.cts.map +1 -1
- package/dist/hooks/form/index.d.ts.map +1 -1
- package/dist/hooks/form/types.d.cts +8 -0
- package/dist/hooks/form/types.d.cts.map +1 -1
- package/dist/hooks/form/types.d.mts +8 -0
- package/dist/hooks/form/types.d.mts.map +8 -0
- package/dist/hooks/form/types.d.ts +8 -0
- package/dist/hooks/form/types.d.ts.map +1 -1
- package/dist/hooks/show/index.d.cts.map +1 -1
- package/dist/hooks/show/index.d.ts.map +1 -1
- package/dist/hooks/show/types.d.cts +4 -0
- package/dist/hooks/show/types.d.cts.map +1 -1
- package/dist/hooks/show/types.d.mts +4 -0
- package/dist/hooks/show/types.d.mts.map +4 -0
- package/dist/hooks/show/types.d.ts +4 -0
- package/dist/hooks/show/types.d.ts.map +1 -1
- package/dist/hooks/useMeta/index.d.cts +3 -0
- package/dist/hooks/useMeta/index.d.cts.map +1 -1
- package/dist/hooks/useMeta/index.d.mts +3 -0
- package/dist/hooks/useMeta/index.d.mts.map +3 -0
- package/dist/hooks/useMeta/index.d.ts +3 -0
- package/dist/hooks/useMeta/index.d.ts.map +1 -1
- package/dist/hooks/useSelect/index.d.cts +10 -2
- package/dist/hooks/useSelect/index.d.cts.map +1 -1
- package/dist/hooks/useSelect/index.d.mts +10 -2
- package/dist/hooks/useSelect/index.d.mts.map +10 -2
- package/dist/hooks/useSelect/index.d.ts +10 -2
- package/dist/hooks/useSelect/index.d.ts.map +1 -1
- package/dist/hooks/useTable/index.d.cts +4 -0
- package/dist/hooks/useTable/index.d.cts.map +1 -1
- package/dist/hooks/useTable/index.d.mts +4 -0
- package/dist/hooks/useTable/index.d.mts.map +4 -0
- package/dist/hooks/useTable/index.d.ts +4 -0
- package/dist/hooks/useTable/index.d.ts.map +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/pages/auth/components/login/index.tsx +7 -2
- package/src/contexts/data/types.ts +72 -0
- package/src/definitions/types/index.ts +40 -0
- package/src/hooks/data/useCreate.ts +93 -32
- package/src/hooks/data/useCreateMany.ts +96 -33
- package/src/hooks/data/useUpdate.ts +137 -53
- package/src/hooks/data/useUpdateMany.ts +140 -51
- package/src/hooks/form/index.ts +2 -0
- package/src/hooks/form/types.ts +10 -0
- package/src/hooks/show/index.ts +1 -0
- package/src/hooks/show/types.ts +4 -0
- package/src/hooks/use-resource-params/index.ts +1 -1
- package/src/hooks/useSelect/index.ts +50 -28
- package/src/hooks/useTable/index.ts +5 -0
- package/dist/hooks/show/useShow.d.cts +0 -57
- package/dist/hooks/show/useShow.d.cts.map +0 -1
- package/dist/hooks/show/useShow.d.mts +0 -57
- package/dist/hooks/show/useShow.d.mts.map +0 -57
- package/dist/hooks/show/useShow.d.ts +0 -57
- package/dist/hooks/show/useShow.d.ts.map +0 -1
- package/src/hooks/show/useShow.ts +0 -179
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,380 @@
|
|
|
1
1
|
# @refinedev/core
|
|
2
2
|
|
|
3
|
+
## 4.54.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#6260](https://github.com/refinedev/refine/pull/6260) [`05b944a75f3a907c0df7b30591a5c5fbbc3cc3f7`](https://github.com/refinedev/refine/commit/05b944a75f3a907c0df7b30591a5c5fbbc3cc3f7) Thanks [@aliemir](https://github.com/aliemir)! - fix(core): `useResourceParams` not reflecting `id` prop changes immediately
|
|
8
|
+
|
|
9
|
+
`useResourceParams` hook was not reflecting the changes in the `id` prop immediately. This was due to the `id` state being set in the `useEffect` hook. This PR fixes the issue by setting the `id` state properly during render rather than after the render is complete.
|
|
10
|
+
|
|
11
|
+
[Fixes #6259](https://github.com/refinedev/refine/issues/6259)
|
|
12
|
+
|
|
13
|
+
- [#6222](https://github.com/refinedev/refine/pull/6222) [`ec24fe0f37aa9b92991bf105719f6f42bb68d63c`](https://github.com/refinedev/refine/commit/ec24fe0f37aa9b92991bf105719f6f42bb68d63c) Thanks [@Sergio16T](https://github.com/Sergio16T)! - feat: added support for meta.gqlVariables to hasura dataProvider. Updated GraphQLQueryOptions to include optional field gqlVariables
|
|
14
|
+
|
|
15
|
+
[Feat #5864](https://github.com/refinedev/refine/issues/5864)
|
|
16
|
+
|
|
17
|
+
## 4.54.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- [#6180](https://github.com/refinedev/refine/pull/6180) [`292cebc5a70f19400793292b79d1400fec114591`](https://github.com/refinedev/refine/commit/292cebc5a70f19400793292b79d1400fec114591) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - feat: [`useSelect`](https://refine.dev/docs/data/hooks/use-select/)'s `queryResult` and `defaultValueQueryResult` is deprecated, use `query` and `defaultValueQuery` instead. #6179
|
|
22
|
+
|
|
23
|
+
```diff
|
|
24
|
+
import { useSelect } from '@refinedev/core';
|
|
25
|
+
|
|
26
|
+
- const { queryResult, defaultValueQueryResult } = useSelect();
|
|
27
|
+
+ const { query, defaultValueQuery } = useSelect();
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
> ✨ You can use `@refinedev/codemod` to automatically migrate your codebase. Simply run the following command in your project's root directory:
|
|
31
|
+
>
|
|
32
|
+
> ```bash
|
|
33
|
+
> npx @refinedev/codemod@latest rename-query-and-mutation-result
|
|
34
|
+
> ```
|
|
35
|
+
|
|
36
|
+
- [#6116](https://github.com/refinedev/refine/pull/6116) [`7e71f12b81954fd3a59678d7fcccd7b557879a94`](https://github.com/refinedev/refine/commit/7e71f12b81954fd3a59678d7fcccd7b557879a94) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - feat: [Mutation parameters](https://refine.dev/docs/data/hooks/use-update/#mutation-parameters) should be given as a prop to the `useUpdate` hook. #6102
|
|
37
|
+
From now on, you can pass mutation parameters to the `useUpdate` hook as a prop.
|
|
38
|
+
|
|
39
|
+
Old usage of `useUpdate` hook:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { useUpdate } from "@refinedev/core";
|
|
43
|
+
|
|
44
|
+
const { mutate } = useUpdate();
|
|
45
|
+
|
|
46
|
+
mutate(
|
|
47
|
+
{
|
|
48
|
+
resource: "products",
|
|
49
|
+
id: 1,
|
|
50
|
+
mutationMode: "optimistic",
|
|
51
|
+
successNotification: false,
|
|
52
|
+
values: {
|
|
53
|
+
name: "New Product",
|
|
54
|
+
material: "Wood",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
onSuccess: () => {
|
|
59
|
+
/* do something after mutation success */
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
New usage of `useUpdate` hook:
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import { useUpdate } from "@refinedev/core";
|
|
69
|
+
|
|
70
|
+
const { mutate } = useUpdate({
|
|
71
|
+
resource: "products",
|
|
72
|
+
successNotification: false,
|
|
73
|
+
mutationMode: "optimistic",
|
|
74
|
+
mutationOptions: {
|
|
75
|
+
onSuccess: () => {
|
|
76
|
+
/* do something after mutation success */
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
mutate({
|
|
82
|
+
// also you can override the parameters given to the hook
|
|
83
|
+
id: 1,
|
|
84
|
+
values: {
|
|
85
|
+
name: "New Product",
|
|
86
|
+
material: "Wood",
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
You can think of the parameters given to the `useUpdate` hook as default values, while the parameters given to the `mutate` function are the values used for that specific mutation or dynamic values.
|
|
92
|
+
|
|
93
|
+
> 🚨 If you pass these parameters to the `mutate` function, it will override the values given to the hook.
|
|
94
|
+
|
|
95
|
+
- [#6116](https://github.com/refinedev/refine/pull/6116) [`7e71f12b81954fd3a59678d7fcccd7b557879a94`](https://github.com/refinedev/refine/commit/7e71f12b81954fd3a59678d7fcccd7b557879a94) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - feat: [Mutation parameters](https://refine.dev/docs/data/hooks/use-create/#mutation-parameters) should be given as a prop to the `useCreate` hook. #6113
|
|
96
|
+
From now on, you can pass mutation parameters to the `useCreate` hook as a prop.
|
|
97
|
+
|
|
98
|
+
Old usage of `useCreate` hook:
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
import { useCreate } from "@refinedev/core";
|
|
102
|
+
|
|
103
|
+
const { mutate } = useCreate();
|
|
104
|
+
|
|
105
|
+
mutate(
|
|
106
|
+
{
|
|
107
|
+
resource: "products",
|
|
108
|
+
values: {
|
|
109
|
+
name: "New Product",
|
|
110
|
+
material: "Wood",
|
|
111
|
+
},
|
|
112
|
+
mutationMode: "optimistic",
|
|
113
|
+
successNotification: false,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
onSuccess: () => {
|
|
117
|
+
/* do something after mutation success */
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
);
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
New usage of `useCreate` hook:
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
import { useCreate } from "@refinedev/core";
|
|
127
|
+
|
|
128
|
+
const { mutate } = useCreate({
|
|
129
|
+
resource: "products",
|
|
130
|
+
successNotification: false,
|
|
131
|
+
mutationMode: "optimistic",
|
|
132
|
+
mutationOptions: {
|
|
133
|
+
onSuccess: () => {
|
|
134
|
+
/* do something after mutation success */
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
mutate({
|
|
140
|
+
// also you can override the parameters given to the hook
|
|
141
|
+
values: {
|
|
142
|
+
name: "New Product",
|
|
143
|
+
material: "Wood",
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
You can think of the parameters given to the `useCreate` hook as default values, while the parameters given to the `mutate` function are the values used for that specific mutation or dynamic values.
|
|
149
|
+
|
|
150
|
+
> 🚨 If you pass these parameters to the `mutate` function, it will override the values given to the hook.
|
|
151
|
+
|
|
152
|
+
- [#6172](https://github.com/refinedev/refine/pull/6172) [`4967a51944c139d102fcfc04ada5a42c725ed7c2`](https://github.com/refinedev/refine/commit/4967a51944c139d102fcfc04ada5a42c725ed7c2) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - feat: [`useTable`](https://refine.dev/docs/data/hooks/use-table/)'s `tableQueryResult` is deprecated, use `tableQuery` instead. #6169
|
|
153
|
+
|
|
154
|
+
```diff
|
|
155
|
+
import { useTable } from '@refinedev/core';
|
|
156
|
+
|
|
157
|
+
- const { tableQueryResult } = useTable();
|
|
158
|
+
+ const { tableQuery } = useTable();
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
> ✨ You can use `@refinedev/codemod` to automatically migrate your codebase. Simply run the following command in your project's root directory:
|
|
162
|
+
>
|
|
163
|
+
> ```bash
|
|
164
|
+
> npx @refinedev/codemod@latest rename-query-and-mutation-result
|
|
165
|
+
> ```
|
|
166
|
+
|
|
167
|
+
- [#6164](https://github.com/refinedev/refine/pull/6164) [`8ed027eec66c41c444f168f4f52e6b51057bc498`](https://github.com/refinedev/refine/commit/8ed027eec66c41c444f168f4f52e6b51057bc498) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - feat: [`useForm`](https://refine.dev/docs/data/hooks/use-form/)'s `queryResult` is deprecated, use `query` instead. #6163
|
|
168
|
+
|
|
169
|
+
```diff
|
|
170
|
+
import { useForm } from '@refinedev/core';
|
|
171
|
+
|
|
172
|
+
- const { queryResult } = useForm();
|
|
173
|
+
+ const { query } = useForm();
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
> ✨ You can use `@refinedev/codemod` to automatically migrate your codebase. Simply run the following command in your project's root directory:
|
|
177
|
+
>
|
|
178
|
+
> ```bash
|
|
179
|
+
> npx @refinedev/codemod@latest rename-query-and-mutation-result
|
|
180
|
+
> ```
|
|
181
|
+
|
|
182
|
+
- [#6116](https://github.com/refinedev/refine/pull/6116) [`7e71f12b81954fd3a59678d7fcccd7b557879a94`](https://github.com/refinedev/refine/commit/7e71f12b81954fd3a59678d7fcccd7b557879a94) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - feat: [Mutation parameters](https://refine.dev/docs/data/hooks/use-create-many/#mutation-parameters) should be given as a prop to the `useCreateMany` hook. #6114
|
|
183
|
+
From now on, you can pass mutation parameters to the `useCreateMany` hook as a prop.
|
|
184
|
+
|
|
185
|
+
Old usage of `useCreateMany` hook:
|
|
186
|
+
|
|
187
|
+
```tsx
|
|
188
|
+
import { useCreateMany } from "@refinedev/core";
|
|
189
|
+
|
|
190
|
+
const { mutate } = useCreateMany();
|
|
191
|
+
|
|
192
|
+
mutate(
|
|
193
|
+
{
|
|
194
|
+
resource: "products",
|
|
195
|
+
values: [
|
|
196
|
+
{
|
|
197
|
+
name: "Product 1",
|
|
198
|
+
material: "Wood",
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "Product 2",
|
|
202
|
+
material: "Metal",
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
mutationMode: "optimistic",
|
|
206
|
+
successNotification: false,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
onSuccess: () => {
|
|
210
|
+
/* do something after mutation success */
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
);
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
New usage of `useCreateMany` hook:
|
|
217
|
+
|
|
218
|
+
```tsx
|
|
219
|
+
import { useCreateMany } from "@refinedev/core";
|
|
220
|
+
|
|
221
|
+
const { mutate } = useCreateMany({
|
|
222
|
+
resource: "products",
|
|
223
|
+
successNotification: false,
|
|
224
|
+
mutationMode: "optimistic",
|
|
225
|
+
mutationOptions: {
|
|
226
|
+
onSuccess: () => {
|
|
227
|
+
/* do something after mutation success */
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
mutate({
|
|
233
|
+
// also you can override the parameters given to the hook
|
|
234
|
+
values: [
|
|
235
|
+
{
|
|
236
|
+
name: "Product 1",
|
|
237
|
+
material: "Wood",
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: "Product 2",
|
|
241
|
+
material: "Metal",
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
});
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
You can think of the parameters given to the `useCreateMany` hook as default values, while the parameters given to the `mutate` function are the values used for that specific mutation or dynamic values.
|
|
248
|
+
|
|
249
|
+
> 🚨 If you pass these parameters to the `mutate` function, it will override the values given to the hook.
|
|
250
|
+
|
|
251
|
+
- [#6174](https://github.com/refinedev/refine/pull/6174) [`2b73e40b0e18932f008842790065cdd386e9d270`](https://github.com/refinedev/refine/commit/2b73e40b0e18932f008842790065cdd386e9d270) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - feat: [`useShow`](https://refine.dev/docs/data/hooks/use-show/)'s `queryResult` is deprecated, use `query` instead. #6173
|
|
252
|
+
|
|
253
|
+
```diff
|
|
254
|
+
import { useShow } from '@refinedev/core';
|
|
255
|
+
|
|
256
|
+
- const { queryResult } = useShow();
|
|
257
|
+
+ const { query } = useShow();
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
> ✨ You can use `@refinedev/codemod` to automatically migrate your codebase. Simply run the following command in your project's root directory:
|
|
261
|
+
>
|
|
262
|
+
> ```bash
|
|
263
|
+
> npx @refinedev/codemod@latest rename-query-and-mutation-result
|
|
264
|
+
> ```
|
|
265
|
+
|
|
266
|
+
- [#6164](https://github.com/refinedev/refine/pull/6164) [`8ed027eec66c41c444f168f4f52e6b51057bc498`](https://github.com/refinedev/refine/commit/8ed027eec66c41c444f168f4f52e6b51057bc498) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - feat: [`useForm`](https://refine.dev/docs/data/hooks/use-form/)'s `mutationResult` is deprecated, use `mutation` instead. #6163
|
|
267
|
+
|
|
268
|
+
```diff
|
|
269
|
+
import { useForm } from '@refinedev/core';
|
|
270
|
+
|
|
271
|
+
- const { mutationResult } = useForm();
|
|
272
|
+
+ const { mutation } = useForm();
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
> ✨ You can use `@refinedev/codemod` to automatically migrate your codebase. Simply run the following command in your project's root directory:
|
|
276
|
+
>
|
|
277
|
+
> ```bash
|
|
278
|
+
> npx @refinedev/codemod@latest rename-query-and-mutation-result
|
|
279
|
+
> ```
|
|
280
|
+
|
|
281
|
+
- [#6125](https://github.com/refinedev/refine/pull/6125) [`61aa3464df0d95c30839726f455ed43e6854730b`](https://github.com/refinedev/refine/commit/61aa3464df0d95c30839726f455ed43e6854730b) Thanks [@Dominic-Preap](https://github.com/Dominic-Preap)! - fix: update debounce behavior on `onSearch` in `useSelect`
|
|
282
|
+
|
|
283
|
+
Now debounce behavior is working correctly on `onSearch` in `useSelect` when using inside `Controller` of react-hook-form.
|
|
284
|
+
|
|
285
|
+
Resolves [#6096](https://github.com/refinedev/refine/issues/6096)
|
|
286
|
+
|
|
287
|
+
- [#6116](https://github.com/refinedev/refine/pull/6116) [`7e71f12b81954fd3a59678d7fcccd7b557879a94`](https://github.com/refinedev/refine/commit/7e71f12b81954fd3a59678d7fcccd7b557879a94) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - feat: [Mutation parameters](https://refine.dev/docs/data/hooks/use-update-many/#mutation-parameters) should be given as a prop to the `useUpdateMany` hook. #6115
|
|
288
|
+
From now on, you can pass mutation parameters to the `useUpdateMany` hook as a prop.
|
|
289
|
+
|
|
290
|
+
Old usage of `useUpdateMany` hook:
|
|
291
|
+
|
|
292
|
+
```tsx
|
|
293
|
+
import { useUpdateMany } from "@refinedev/core";
|
|
294
|
+
|
|
295
|
+
const { mutate } = useUpdateMany();
|
|
296
|
+
|
|
297
|
+
mutate(
|
|
298
|
+
{
|
|
299
|
+
resource: "products",
|
|
300
|
+
values: {
|
|
301
|
+
name: "New Product",
|
|
302
|
+
material: "Wood",
|
|
303
|
+
},
|
|
304
|
+
ids: [1, 2, 3],
|
|
305
|
+
mutationMode: "optimistic",
|
|
306
|
+
successNotification: false,
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
onSuccess: () => {
|
|
310
|
+
/* do something after mutation success */
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
);
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
New usage of `useUpdateMany` hook:
|
|
317
|
+
|
|
318
|
+
```tsx
|
|
319
|
+
import { useUpdateMany } from "@refinedev/core";
|
|
320
|
+
|
|
321
|
+
const { mutate } = useUpdateMany({
|
|
322
|
+
resource: "products",
|
|
323
|
+
successNotification: false,
|
|
324
|
+
mutationMode: "optimistic",
|
|
325
|
+
mutationOptions: {
|
|
326
|
+
onSuccess: () => {
|
|
327
|
+
/* do something after mutation success */
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
mutate({
|
|
333
|
+
ids: [1, 2, 3],
|
|
334
|
+
values: {
|
|
335
|
+
name: "New Product",
|
|
336
|
+
material: "Wood",
|
|
337
|
+
},
|
|
338
|
+
// also you can override the parameters given to the hook
|
|
339
|
+
});
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
You can think of the parameters given to the `useUpdateMany` hook as default values, while the parameters given to the `mutate` function are the values used for that specific mutation or dynamic values.
|
|
343
|
+
|
|
344
|
+
> 🚨 If you pass these parameters to the `mutate` function, it will override the values given to the hook.
|
|
345
|
+
|
|
346
|
+
### Patch Changes
|
|
347
|
+
|
|
348
|
+
- [#6185](https://github.com/refinedev/refine/pull/6185) [`603c73eb7d376fc2357a577f5921f844a8f444e4`](https://github.com/refinedev/refine/commit/603c73eb7d376fc2357a577f5921f844a8f444e4) Thanks [@aliemir](https://github.com/aliemir)! - Bump `@refinedev/devtools-internal` dependency to reflect the latest changes in the Refine Devtools.
|
|
349
|
+
|
|
350
|
+
- [#6224](https://github.com/refinedev/refine/pull/6224) [`81703b62bafeb01a75290b99b3869ef96d04bd94`](https://github.com/refinedev/refine/commit/81703b62bafeb01a75290b99b3869ef96d04bd94) Thanks [@WananiAdib](https://github.com/WananiAdib)! - fix(core): fixed type issue in useSelect. #6223
|
|
351
|
+
|
|
352
|
+
Previously, the types would not allow functions to be passed as props. After this change, it will be possible.
|
|
353
|
+
|
|
354
|
+
[Resolves #6223](https://github.com/refinedev/refine/issues/6223)
|
|
355
|
+
|
|
356
|
+
- [#6184](https://github.com/refinedev/refine/pull/6184) [`1f7976bd32da311367945370efccd7d9c9b102a7`](https://github.com/refinedev/refine/commit/1f7976bd32da311367945370efccd7d9c9b102a7) Thanks [@Sarfraz-droid](https://github.com/Sarfraz-droid)! - AuthPage in Next.js generates code with i18n but the folder hooks is not created. imported useTranslate from @hooks to fix the issue
|
|
357
|
+
|
|
358
|
+
- [#6116](https://github.com/refinedev/refine/pull/6116) [`7e71f12b81954fd3a59678d7fcccd7b557879a94`](https://github.com/refinedev/refine/commit/7e71f12b81954fd3a59678d7fcccd7b557879a94) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - fix: `invalidates` prop of `useUpdateMany` doesn't work. #6209
|
|
359
|
+
|
|
360
|
+
From now on, the `invalidates` prop of the `useUpdateMany` hook will work as expected.
|
|
361
|
+
|
|
362
|
+
```tsx
|
|
363
|
+
const { mutate } = useUpdateMany({
|
|
364
|
+
resource: "posts",
|
|
365
|
+
invalidates: ["all"], // invalidates all queries of the "posts" resource
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
mutate({ ids: [1, 2, 3], values: { title: "new title" } });
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
- [#6154](https://github.com/refinedev/refine/pull/6154) [`fa2d7a4554da2d5fb2432a011941f9c157b59aba`](https://github.com/refinedev/refine/commit/fa2d7a4554da2d5fb2432a011941f9c157b59aba) Thanks [@BatuhanW](https://github.com/BatuhanW)! - chore(devtools): bump internal devtools dependency
|
|
372
|
+
|
|
373
|
+
Bump `@refinedev/devtools-internal` version.
|
|
374
|
+
|
|
375
|
+
- Updated dependencies [[`ccddff6eba23286d4025a7301de3ebfc24b1b633`](https://github.com/refinedev/refine/commit/ccddff6eba23286d4025a7301de3ebfc24b1b633), [`603c73eb7d376fc2357a577f5921f844a8f444e4`](https://github.com/refinedev/refine/commit/603c73eb7d376fc2357a577f5921f844a8f444e4)]:
|
|
376
|
+
- @refinedev/devtools-internal@1.1.14
|
|
377
|
+
|
|
3
378
|
## 4.53.0
|
|
4
379
|
|
|
5
380
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/pages/auth/components/login/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/pages/auth/components/login/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAWxC,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,aAAa,CAAC;AAElE,KAAK,UAAU,GAAG,cAAc,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;AAE5E,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAmL1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/pages/auth/components/login/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/pages/auth/components/login/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAWxC,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,aAAa,CAAC;AAElE,KAAK,UAAU,GAAG,cAAc,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;AAE5E,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAmL1C,CAAC"}
|
|
@@ -88,6 +88,77 @@ export type GraphQLQueryOptions = {
|
|
|
88
88
|
* ```
|
|
89
89
|
*/
|
|
90
90
|
gqlMutation?: DocumentNode;
|
|
91
|
+
/**
|
|
92
|
+
* @description GraphQL Variables to be used for more advanced query filters by data providers. If filters correspond to table columns,
|
|
93
|
+
* these variables will not be presented in the initial filters selected and will not be reset or set by table column filtering.
|
|
94
|
+
* @optional
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* import gql from "graphql-tag";
|
|
98
|
+
* import { useTable } from "@refinedev/antd";
|
|
99
|
+
* import type { GetFieldsFromList } from "@refinedev/hasura";
|
|
100
|
+
* import type { GetPostsQuery } from "graphql/types";
|
|
101
|
+
*
|
|
102
|
+
* const POSTS_QUERY = gql`
|
|
103
|
+
* query GetPosts(
|
|
104
|
+
* $offset: Int!
|
|
105
|
+
* $limit: Int!
|
|
106
|
+
* $order_by: [posts_order_by!]
|
|
107
|
+
* $where: posts_bool_exp
|
|
108
|
+
* ) {
|
|
109
|
+
* posts(
|
|
110
|
+
* offset: $offset
|
|
111
|
+
* limit: $limit
|
|
112
|
+
* order_by: $order_by
|
|
113
|
+
* where: $where
|
|
114
|
+
* ) {
|
|
115
|
+
* id
|
|
116
|
+
* title
|
|
117
|
+
* category {
|
|
118
|
+
* id
|
|
119
|
+
* title
|
|
120
|
+
* }
|
|
121
|
+
* }
|
|
122
|
+
* posts_aggregate(where: $where) {
|
|
123
|
+
* aggregate {
|
|
124
|
+
* count
|
|
125
|
+
* }
|
|
126
|
+
* }
|
|
127
|
+
* } `;
|
|
128
|
+
*
|
|
129
|
+
*
|
|
130
|
+
* export const PostList = () => {
|
|
131
|
+
* const { tableProps } = useTable<
|
|
132
|
+
* GetFieldsFromList<GetPostsQuery>
|
|
133
|
+
* >({
|
|
134
|
+
* meta: {
|
|
135
|
+
* gqlQuery: POSTS_QUERY,
|
|
136
|
+
* gqlVariables: {
|
|
137
|
+
* where: {
|
|
138
|
+
* _and: [
|
|
139
|
+
* {
|
|
140
|
+
* title: {
|
|
141
|
+
* _ilike: "%Updated%",
|
|
142
|
+
* },
|
|
143
|
+
* },
|
|
144
|
+
* {
|
|
145
|
+
* created_at: {
|
|
146
|
+
* _gte: "2023-08-04T08:26:26.489116+00:00"
|
|
147
|
+
* }
|
|
148
|
+
* }
|
|
149
|
+
* ],
|
|
150
|
+
* },
|
|
151
|
+
* },
|
|
152
|
+
* }
|
|
153
|
+
* });
|
|
154
|
+
* return ( <Table {...tableProps}/>);
|
|
155
|
+
* }
|
|
156
|
+
*
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
gqlVariables?: {
|
|
160
|
+
[key: string]: any;
|
|
161
|
+
};
|
|
91
162
|
};
|
|
92
163
|
export type MetaQuery = {
|
|
93
164
|
[k: string]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/contexts/data/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC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AAU,GAAG,EAAE,EAClE,MAAM,EAAE,gBAAgB,CAAC,UAAU,CAAC,KACjC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAExC,SAAS,EAAE,CAAC,KAAK,SAAS,UAAU,GAAG,UAAU,EAAE,UAAU,GAAG,EAAE,EAChE,MAAM,EAAE,eAAe,CAAC,UAAU,CAAC,KAChC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IAEvC,UAAU,CAAC,EAAE,CAAC,KAAK,SAAS,UAAU,GAAG,UAAU,EAAE,UAAU,GAAG,EAAE,EAClE,MAAM,EAAE,gBAAgB,CAAC,UAAU,CAAC,KACjC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAExC,SAAS,EAAE,MAAM,MAAM,CAAC;IAExB,MAAM,CAAC,EAAE,CACP,KAAK,SAAS,UAAU,GAAG,UAAU,EACrC,MAAM,GAAG,OAAO,EAChB,QAAQ,GAAG,OAAO,EAElB,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,KACnC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,YAAY,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,aAAa,CAAC"}
|
|
@@ -88,6 +88,77 @@ export type GraphQLQueryOptions = {
|
|
|
88
88
|
* ```
|
|
89
89
|
*/
|
|
90
90
|
gqlMutation?: DocumentNode;
|
|
91
|
+
/**
|
|
92
|
+
* @description GraphQL Variables to be used for more advanced query filters by data providers. If filters correspond to table columns,
|
|
93
|
+
* these variables will not be presented in the initial filters selected and will not be reset or set by table column filtering.
|
|
94
|
+
* @optional
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* import gql from "graphql-tag";
|
|
98
|
+
* import { useTable } from "@refinedev/antd";
|
|
99
|
+
* import type { GetFieldsFromList } from "@refinedev/hasura";
|
|
100
|
+
* import type { GetPostsQuery } from "graphql/types";
|
|
101
|
+
*
|
|
102
|
+
* const POSTS_QUERY = gql`
|
|
103
|
+
* query GetPosts(
|
|
104
|
+
* $offset: Int!
|
|
105
|
+
* $limit: Int!
|
|
106
|
+
* $order_by: [posts_order_by!]
|
|
107
|
+
* $where: posts_bool_exp
|
|
108
|
+
* ) {
|
|
109
|
+
* posts(
|
|
110
|
+
* offset: $offset
|
|
111
|
+
* limit: $limit
|
|
112
|
+
* order_by: $order_by
|
|
113
|
+
* where: $where
|
|
114
|
+
* ) {
|
|
115
|
+
* id
|
|
116
|
+
* title
|
|
117
|
+
* category {
|
|
118
|
+
* id
|
|
119
|
+
* title
|
|
120
|
+
* }
|
|
121
|
+
* }
|
|
122
|
+
* posts_aggregate(where: $where) {
|
|
123
|
+
* aggregate {
|
|
124
|
+
* count
|
|
125
|
+
* }
|
|
126
|
+
* }
|
|
127
|
+
* } `;
|
|
128
|
+
*
|
|
129
|
+
*
|
|
130
|
+
* export const PostList = () => {
|
|
131
|
+
* const { tableProps } = useTable<
|
|
132
|
+
* GetFieldsFromList<GetPostsQuery>
|
|
133
|
+
* >({
|
|
134
|
+
* meta: {
|
|
135
|
+
* gqlQuery: POSTS_QUERY,
|
|
136
|
+
* gqlVariables: {
|
|
137
|
+
* where: {
|
|
138
|
+
* _and: [
|
|
139
|
+
* {
|
|
140
|
+
* title: {
|
|
141
|
+
* _ilike: "%Updated%",
|
|
142
|
+
* },
|
|
143
|
+
* },
|
|
144
|
+
* {
|
|
145
|
+
* created_at: {
|
|
146
|
+
* _gte: "2023-08-04T08:26:26.489116+00:00"
|
|
147
|
+
* }
|
|
148
|
+
* }
|
|
149
|
+
* ],
|
|
150
|
+
* },
|
|
151
|
+
* },
|
|
152
|
+
* }
|
|
153
|
+
* });
|
|
154
|
+
* return ( <Table {...tableProps}/>);
|
|
155
|
+
* }
|
|
156
|
+
*
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
gqlVariables?: {
|
|
160
|
+
[key: string]: any;
|
|
161
|
+
};
|
|
91
162
|
};
|
|
92
163
|
export type MetaQuery = {
|
|
93
164
|
[k: string]: any;
|
|
@@ -88,6 +88,77 @@ export type GraphQLQueryOptions = {
|
|
|
88
88
|
* ```
|
|
89
89
|
*/
|
|
90
90
|
gqlMutation?: DocumentNode;
|
|
91
|
+
/**
|
|
92
|
+
* @description GraphQL Variables to be used for more advanced query filters by data providers. If filters correspond to table columns,
|
|
93
|
+
* these variables will not be presented in the initial filters selected and will not be reset or set by table column filtering.
|
|
94
|
+
* @optional
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* import gql from "graphql-tag";
|
|
98
|
+
* import { useTable } from "@refinedev/antd";
|
|
99
|
+
* import type { GetFieldsFromList } from "@refinedev/hasura";
|
|
100
|
+
* import type { GetPostsQuery } from "graphql/types";
|
|
101
|
+
*
|
|
102
|
+
* const POSTS_QUERY = gql`
|
|
103
|
+
* query GetPosts(
|
|
104
|
+
* $offset: Int!
|
|
105
|
+
* $limit: Int!
|
|
106
|
+
* $order_by: [posts_order_by!]
|
|
107
|
+
* $where: posts_bool_exp
|
|
108
|
+
* ) {
|
|
109
|
+
* posts(
|
|
110
|
+
* offset: $offset
|
|
111
|
+
* limit: $limit
|
|
112
|
+
* order_by: $order_by
|
|
113
|
+
* where: $where
|
|
114
|
+
* ) {
|
|
115
|
+
* id
|
|
116
|
+
* title
|
|
117
|
+
* category {
|
|
118
|
+
* id
|
|
119
|
+
* title
|
|
120
|
+
* }
|
|
121
|
+
* }
|
|
122
|
+
* posts_aggregate(where: $where) {
|
|
123
|
+
* aggregate {
|
|
124
|
+
* count
|
|
125
|
+
* }
|
|
126
|
+
* }
|
|
127
|
+
* } `;
|
|
128
|
+
*
|
|
129
|
+
*
|
|
130
|
+
* export const PostList = () => {
|
|
131
|
+
* const { tableProps } = useTable<
|
|
132
|
+
* GetFieldsFromList<GetPostsQuery>
|
|
133
|
+
* >({
|
|
134
|
+
* meta: {
|
|
135
|
+
* gqlQuery: POSTS_QUERY,
|
|
136
|
+
* gqlVariables: {
|
|
137
|
+
* where: {
|
|
138
|
+
* _and: [
|
|
139
|
+
* {
|
|
140
|
+
* title: {
|
|
141
|
+
* _ilike: "%Updated%",
|
|
142
|
+
* },
|
|
143
|
+
* },
|
|
144
|
+
* {
|
|
145
|
+
* created_at: {
|
|
146
|
+
* _gte: "2023-08-04T08:26:26.489116+00:00"
|
|
147
|
+
* }
|
|
148
|
+
* }
|
|
149
|
+
* ],
|
|
150
|
+
* },
|
|
151
|
+
* },
|
|
152
|
+
* }
|
|
153
|
+
* });
|
|
154
|
+
* return ( <Table {...tableProps}/>);
|
|
155
|
+
* }
|
|
156
|
+
*
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
gqlVariables?: {
|
|
160
|
+
[key: string]: any;
|
|
161
|
+
};
|
|
91
162
|
};
|
|
92
163
|
export type MetaQuery = {
|
|
93
164
|
[k: string]: any;
|