redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

Add support for generated RTK queries hooks tsdoc documentation

Open BSoDium opened this issue 2 years ago • 2 comments

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!

BSoDium avatar Aug 28 '23 12:08 BSoDium

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.

markerikson avatar Feb 06 '24 00:02 markerikson

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.

BSoDium avatar May 04 '24 12:05 BSoDium

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.

markerikson avatar Sep 22 '24 11:09 markerikson