openapi-react-query-codegen icon indicating copy to clipboard operation
openapi-react-query-codegen copied to clipboard

Is this dead?

Open mvarchdev opened this issue 6 months ago • 16 comments

Hello!

Me with my team are thinking to use this library, but we have only one concern.. Is it dead? What is the status of the project?

It seems to me that it have issues that are not even started to be solved

mvarchdev avatar May 27 '25 20:05 mvarchdev

The underlying code generation library this codegen tool is using (hey-api) now has it's own first-party @tanstack/react-query generator plugin and it's more actively maintained: https://heyapi.dev/openapi-ts/plugins/tanstack-query

alula avatar Jul 22 '25 06:07 alula

Not saying this project is dead. I have switched to using @hey-api/openapi-ts and making updates to that repo. I was a maintainer of this project.

seriouslag avatar Jul 28 '25 22:07 seriouslag

But the native hey-api plugin, does not generate hooks, like this lib?

trabati avatar Aug 14 '25 09:08 trabati

But the native hey-api plugin, does not generate hooks, like this lib?

Yes it does. You must specify @tanstack/react-query in plugins. It's in the docs on the site if you need more info.

seriouslag avatar Aug 14 '25 14:08 seriouslag

Here are the plugin docs, I dont see any mentioning about the hooks there, could you point me at it please?

https://heyapi.dev/openapi-ts/plugins/tanstack-query

trabati avatar Aug 18 '25 10:08 trabati

Here are the plugin docs, I dont see any mentioning about the hooks there, could you point me at it please?

https://heyapi.dev/openapi-ts/plugins/tanstack-query

https://heyapi.dev/openapi-ts/plugins/tanstack-query#queries

seriouslag avatar Aug 18 '25 13:08 seriouslag

Still don't get it. The part you link to clearly mentions only query functions like getPetByIdOptions, that is not a generated hook like with this package here. Which would result in something like usePetsServiceGetPetsById.

From your link: Image

trabati avatar Aug 18 '25 13:08 trabati

Those are the generated options to pass to react query.

seriouslag avatar Aug 18 '25 13:08 seriouslag

Wait, what? You suggested hey-api as an alternative to this package. I pointed out that it’s not a real alternative because it doesn’t generate the API hooks. Then you said it does, and now you’re saying you were only talking about query options?

Are you even following the conversation here?

Image

trabati avatar Aug 18 '25 13:08 trabati

Wait, what? You suggested hey-api as an alternative to this package. I pointed out that it’s not a real alternative because it doesn’t generate the API hooks. Then you said it does, and now you’re saying you were only talking about query options?

Are you even following the conversation here?

Image

Seems you are frustrated. This is my final note on this.

OpenAPI-ts tool offers more functionality with and generates a similar API. Instead of using a generated hook that you have limited control and it makes it difficult to override options, and maintain, openapi-ts generates the options to provide to react query. I recommend trying it out and seeing how it works nearly the same and is easier to override options.

This library uses OpenAPI-ts under the hood so it made sense to me to switch.

seriouslag avatar Aug 18 '25 13:08 seriouslag

I understand all of that — but that wasn’t the question.

What you’re missing is that you pointed me in the completely wrong direction by claiming it generates the “hooks,” which it clearly does not.

Of course I am frustrated after wasting a lot of time reading into the docs, and searching for what is not there

trabati avatar Aug 18 '25 13:08 trabati

@trabati Was looking for the same, seems https://www.kubb.dev/plugins/plugin-react-query/ to be an interesting possible alternative

vitbokisch avatar Aug 25 '25 09:08 vitbokisch

@trabati @vitbokisch noted, I'll update https://github.com/hey-api/openapi-ts/issues/1721 when it's available

mrlubos avatar Aug 27 '25 23:08 mrlubos

It would be awesome if there was a easy way to migrate to hey-api from this project. Maybe its just a plugin that generates similar apis so users could easily migrate.

amcdnl avatar Nov 04 '25 13:11 amcdnl

@amcdnl Yeah, migrations are pain. Some of the core logic would be hard to align, but at least function signatures could be similar potentially. Sadly it's hard to justify working on migrations when there's a ton of other features waiting 😔

mrlubos avatar Nov 04 '25 16:11 mrlubos

@amcdnl Yeah, migrations are pain. Some of the core logic would be hard to align, but at least function signatures could be similar potentially. Sadly it's hard to justify working on migrations when there's a ton of other features waiting 😔

I completely understand. 🙈

amcdnl avatar Nov 04 '25 18:11 amcdnl

But is it still posible to use this lib?

NKT-FRLV avatar Nov 20 '25 20:11 NKT-FRLV