hey-api / openapi-ts

🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more. Support: @mrlubos
https://heyapi.dev
Other
1.39k stars 107 forks source link

Issue with TanStack Query Plugin: asClass Field Not Grouping Output Properly #1190

Closed dengyong-ola closed 4 weeks ago

dengyong-ola commented 4 weeks ago

Description

The TanStack Query plugin does not follow the asClass field in the configuration. When I set the asClass field to true, the generated react-query.gen.ts file is not grouped like the service.gen.ts file.

Reproducible example or configuration

https://stackblitz.com/edit/hey-api-client-fetch-example

OpenAPI specification (optional)

No response

System information (optional)

No response

stackblitz[bot] commented 4 weeks ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

mrlubos commented 4 weeks ago

Hi @dengyong-ola:

  1. Why would you expect the TanStack plugin output to follow the same pattern?
  2. What would you expect the output to look like, including query keys, mutations, queries, and infinite queries?
dengyong-ola commented 4 weeks ago

Sorry, maybe I was hasty. I just had a gut feeling it should be this way.

mrlubos commented 4 weeks ago

@dengyong-ola Well, maybe! I'd like to understand why people prefer certain syntax over another. Previously I've been told they don't mind what this output looks like