-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
"error TS6133: 'queryKey' is declared but its value is never read" from queries.ts and suspense.ts #112
Comments
Does this report, just like mine, need to go to upstream https://github.com/hey-api/openapi-ts as well? |
I'd like an answer to the question above, as we need a fix to this issue, and need to know whether we should create a ticket upstream. |
This is a bug. A work-around until a fix is implemented is to add the // @ts-nocheck to the files or to add the following properties to your tsconfig {
...
"noUnusedParameters": false,
"noUnusedLocals": false
...
} |
Thanks for the reply, I will be following this issue to see when a proper fix is implemented so we can remove our workarounds for it. |
There is a bug [1] in the codegen tool that causes it to generate unused query keys for requests with no parameters. This commit renames the unused query keys to start with an underscore '_' to pass the lint checks for unused variables. NOTE: This is not a lasting solution, as every regeneration of the query client will revert these changes. [1]: 7nohe/openapi-react-query-codegen#112 Signed-off-by: Jyrki Keisala <[email protected]>
There is a bug [1] in the codegen tool that causes it to generate unused query keys for requests with no parameters. This commit renames the unused query keys to start with an underscore '_' to pass the lint checks for unused variables. NOTE: This is not a lasting solution, as every regeneration of the query client will revert these changes. [1]: 7nohe/openapi-react-query-codegen#112 Signed-off-by: Jyrki Keisala <[email protected]>
The query key functions for queries that don't take in additional request parameters don't allow for using additional query key input, but query hooks always take in a query key parameter. This leads to the query key parameter in hooks without additional input being unused variable, leading to TypeScript erroring. Fix this by always taking query key parameter in query key functions, and always using it in query hooks. Fixes 7nohe#112. Signed-off-by: Mikko Murto <[email protected]>
Describe the bug
Files
queries/queries.ts
andqueries/suspense.ts
generate TS errors fromqueryKey
being declared but its value never read, resulting in error TS6133 when building a project with the API.OpenAPI JSON causing the bug
api.json
Expected behavior
Either don't generate unused parameters, or auto-insert
to generated files which may declare unused variables.
The text was updated successfully, but these errors were encountered: