7nohe / openapi-react-query-codegen

OpenAPI React Query Codegen is a code generator for creating React Query (also known as TanStack Query) hooks based on your OpenAPI schema.
https://openapi-react-query-codegen.vercel.app
MIT License
298 stars 30 forks source link

"--operationId" still includes service name #133

Closed maxoosterveen closed 1 month ago

maxoosterveen commented 3 months ago

Describe the bug When running the generator command with the option --operationId still includes the service names in the hooks

To Reproduce Steps to reproduce the behavior: pnpm exec openapi-rq -i ./internal.json --operationId

OpenAPI spec file If possible, please upload the OpenAPI spec file.

Expected behavior A clear and concise description of what you expected to happen. Instead of having the service name in the function hook, I would like it to only use the operation id. useServiceNameOperationId > useOperationId

Screenshots If applicable, add screenshots or logs to help explain your problem.

Additional context Add any other context about the problem here.

7nohe commented 3 months ago

@maxoosterveen Thank you for the report. The --operationId is an option from @hey-api/openapi-ts, but it seems we haven't been able to pass it correctly from our library. I will fix it.

JoeHillyard commented 1 month ago

This is blocking for me on migrating over - any pointers on where to start looking?

7nohe commented 1 month ago

@maxoosterveen @JoeHillyard Sorry for the delayed response. The issue has been fixed in #151. A pre-release version has been published, so you can test it by installing the following version.

npm i -D @7nohe/openapi-react-query-codegen@0.0.0-ef2157e65a33494afbc157e7e72b47353a84e49a

If there are no issues, I will merge this PR and release it.

JoeHillyard commented 1 month ago

Hmm i don't seem to be having any luck - service name is still coming through

nickdaugherty commented 1 month ago

Same - still getting service names when using version 0.0.0-ef2157e65a33494afbc157e7e72b47353a84e49a

7nohe commented 1 month ago

We have adopted Flat Services from version 2 to support tree-shaking, and as a result, service names have been deprecated.