-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@kubb/plugin-vue-query: Export underlying fetch function #1497
Comments
You could use the client plugin to generate fetch functions, see https://www.kubb.dev/plugins/plugin-client/ |
Even though the user can provide their own fetch functions, I think, exporting the default Currently, kubb generates code (from
The
With this, the generated code would look like this:
The same approach should also be used for The pluginReactQuery can then also use this userland import-path:
It offers at least the following benefits:
|
@nimo23 the changes you mention might be another another usefull addition but I think it does not cover the issue I described above. Have a look at the generated content in: What I would like to have is, that the
|
What is the problem this feature would solve?
We are using kubb now to orchestrate the communication with 4 different services.
The generated API Clients and Types from the OpenAPI docs saves A TON of manual written code. So thanks for that great library!
There is currently just a small issue.
The files for the generated API Endpoints currently include the following functions:
The last one is not exported from the file which would be great as we need to perform some prefetching throughout our application to make sure important data is available.
As there is no automatically generated method for prefetching, we could contructs those ourselves with the help of the generated getQueryKeyForXY and getXY methods without creating duplicated "fetch methods".
External documents/projects?
No response
What is the feature you are proposing to solve the problem?
Export the underlying fetch method to make it available in Userland.
What alternatives have you considered?
Write the fetch method including the required url manually (which should not be necessary).
The text was updated successfully, but these errors were encountered: