You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not exactly a reproducible issue other than the fact that generated react-query mutations do not have mutationKeys by default.
What happens?
When using a standard orval configuration for react-query no mutations have mutationKeys by default.
What were you expecting to hoping could happen?
Rather than having to manually add mutationKeys to every operation by hand, it would be awesome if orval could add a default mutationKey that is just the name of the mutator (e.g. useCreateUser).
This would allow someone (me 😁) to use a single mutationOptions override to handle case-by-case scenarios for different mutations based on the mutationKey.
Currently my custom mutationOptions override gets nicely inserted into each mutation, but there's no way for me to identify within the custom option implementation which mutation is happening. I can only provide generic mutation overrides (e.g. retryDelay).
With a mutationKey provided I could know which mutation is happening and then safely perform invalidations or local cache updates within onSuccess.
What are the steps to reproduce this issue?
Not exactly a reproducible issue other than the fact that generated
react-query
mutations do not havemutationKey
s by default.What happens?
When using a standard
orval
configuration forreact-query
no mutations havemutationKey
s by default.What were you
expecting tohoping could happen?Rather than having to manually add
mutationKey
s to every operation by hand, it would be awesome iforval
could add a defaultmutationKey
that is just the name of the mutator (e.g.useCreateUser
).This would allow someone (me 😁) to use a single
mutationOptions
override to handle case-by-case scenarios for different mutations based on themutationKey
.Currently my custom
mutationOptions
override gets nicely inserted into each mutation, but there's no way for me to identify within the custom option implementation which mutation is happening. I can only provide generic mutation overrides (e.g.retryDelay
).With a
mutationKey
provided I could know which mutation is happening and then safely perform invalidations or local cache updates withinonSuccess
.Any logs, error output, etc?
No logs or errors.
Any other comments?
n/a
What versions are you using?
Operating System: Ubuntu 22.04
Package Version:
6.25.0
Browser Version: n/a
The text was updated successfully, but these errors were encountered: