-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
@tanstack/react-query
is not compatible with asClass
services
#1090
Comments
Hey! What would you expect the resulting code to look like? |
Hello. I would expect the grouped services to be imported instead. The generated services look the following way: export class MyService {
public static getEp1<
ThrowOnError extends boolean = false,
>(options) {/*...*/}
public static getEp2<
ThrowOnError extends boolean = false,
>(options) {/*...*/}
} so the import should be: import {
client,
MyService
} from "../services.gen"; I would expect the static classes to be imported. Instead, the plugin always assumes a flat structure. |
@prenaissance Do you expect the TanStack functions to be flat? Grouped? |
@mrlubos I don't have a preference about that. The issues is that |
No need, that much is clear. Why do you have a preference for using asClass: true but no preference for TanStack functions? |
Description
Turning on both
asClass
services and the tanstack query plugin resulting in wrong imports in thereact-query.gen.ts
file:Reproducible example or configuration
OpenAPI specification (optional)
No response
System information (optional)
OS - Ubuntu 22.04 on WSL2,
Package manager - pnpm 9.10.0
Node version - 22.9.0
openapi-ts version - 0.53.4
typescript version - 5.6.2
The text was updated successfully, but these errors were encountered: