Commit 8f4ae4a
authored
fix(query): pass operationId and operationName to queryOptions mutator (#3427)
* fix(query): pass operationId and operationName to queryOptions mutator
The `mutationOptions` mutator has received `{ operationId, operationName }`
as its third argument since #1974, but the symmetric `queryOptions` mutator
was left with only `{ url }`. That asymmetry made it impossible to write
`queryOptions` overrides that branch on operation identity (e.g. attach
per-operation metadata or invalidate by `operationId`).
Extend the third argument of `queryOptions` mutator calls from `{ url }`
to `{ url, operationId, operationName }`. The change is additive —
mutators that today read `arg3.url` keep working unchanged. Both call
sites are updated: the main query options builder and the
`applyQueryOptionsMutator` helper that backs `invalidate`/`set`/`get`.
The 2nd-arg asymmetry between `queryOptions` (`{ queryProperties }`) and
`mutationOptions` (`{ url }`) is shipped behaviour and is left alone.
Closes #3153
* docs(query): correct queryOptions vs mutationOptions 3rd-arg shapes
test(query): decouple operationName from operationId in #3153 regression1 parent d5df441 commit 8f4ae4a
26 files changed
Lines changed: 1608 additions & 2 deletions
File tree
- docs/content/docs/reference/configuration
- packages/query/src
- tests
- __snapshots__/react-query/custom-query-options-with-operation
- model
- configs
- mutators
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
861 | 870 | | |
862 | 871 | | |
863 | 872 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| |||
382 | 383 | | |
383 | 384 | | |
384 | 385 | | |
| 386 | + | |
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
| |||
652 | 654 | | |
653 | 655 | | |
654 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
655 | 660 | | |
656 | 661 | | |
657 | 662 | | |
658 | 663 | | |
659 | 664 | | |
660 | | - | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
661 | 668 | | |
662 | 669 | | |
663 | 670 | | |
| |||
733 | 740 | | |
734 | 741 | | |
735 | 742 | | |
736 | | - | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
737 | 746 | | |
738 | 747 | | |
739 | 748 | | |
| |||
1145 | 1154 | | |
1146 | 1155 | | |
1147 | 1156 | | |
| 1157 | + | |
1148 | 1158 | | |
1149 | 1159 | | |
1150 | 1160 | | |
| |||
0 commit comments