Allow passing all options to generated ...queryOptions and ...mutationOptions functions
#2133
Valentinusz
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
@Valentinusz Will this new feature help you out here: https://www.kubb.dev/changelog#_4-15-0? See https://www.kubb.dev/plugins/plugin-react-query/#customoptions |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the generated query and mutation option functions only accept request config options.
Generated hooks on the other hand have a
query/mutationfield that allows the passing of additional options.The tanstack query docs mention https://tanstack.com/query/latest/docs/framework/react/guides/query-options this pattern where instead of defining wrapper hooks you just directly pass the
queryOptions/mutationOptionstouseQuery/useMutation.This is currently not useable for some cases. E.g.:
On the other hand this works:
My proposal is to add
mutationandqueryoptions present on the hooks to the option factory functions as well.I think this would be a valuable addition since, it can reduce the amount of code that has to be generated as we no longer have to generate wrapper hooks.
Beta Was this translation helpful? Give feedback.
All reactions