reduxjs / redux-toolkit

The official, opinionated, batteries-included toolset for efficient Redux development
https://redux-toolkit.js.org
MIT License
10.69k stars 1.16k forks source link

Add support for generated RTK queries hooks tsdoc documentation #3680

Closed BSoDium closed 1 week ago

BSoDium commented 1 year ago

Hi, I'm currently working with a very heavy API with long and complex endpoint names, which sometimes makes for some scarily obscure hook calls.

I was wondering if there was any way to generate some sort of tsdoc-style documentation for the generated hooks, so compatible editors can display a detailed description of the hook on hover (the description could be put together from the summary and description fields in the OpenAPI schema, if available) , or if there was any way to customise the generation process so these can be added on a per-repository basis, since this may be a very specific feature that not many people actually need.

Thanks a lot in advance for your help, and keep up the amazing work!

markerikson commented 8 months ago

My assumption is this probably isn't feasible - the hooks are generated internally per API endpoint, and I would be surprised if there's a way to carry any kind of comment docblock over from the endpoint definition.

BSoDium commented 5 months ago

To be more explicit I was looking for a way to somehow insert some code/modify the code generation process so it does carry this kind of useful piece of documentation through. Sounds to me like a feature which many could benefit from.

markerikson commented 1 week ago

If you can come up with a working PR we might be able to take a look, but I don't think this is anything we're going to tackle ourselves.