dotansimha / dotansimha/graphql-code-generator
issues with generated file after react query v5 migration
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
Description
### Which packages are impacted by your issue?
@graphql-codegen/cli
### Describe the bug
I'm having several issues after migrating tanstack query to v5. Is there anything I might have missed in the codegen.ts? how can I fix the warnings in generated.ts.
how do I pass options to the query? the app doesn't want to start due to bad argument type
```
const currentUserQuery = useCurrentUserQuery({ enabled: !isLoggingIn });
TS2322: Type boolean is not assignable to type never
```
### Your Example Website or App
can't share
### Steps to Reproduce the Bug or Issue
1. upgrade react query
### Expected behavior
no warnings in generated.ts and no issues with useQuery or useMutation hooks
### Screenshots or Videos

`const currentUserQuery = useCurrentUserQuery({ enabled: !isLoggingIn });`
`TS2322: Type boolean is not assignable to type never`
### Platform
- OS: macOS
- NodeJS: 18.18.2
- `graphql` version: 16.8.1
- `@graphql-codegen/*` version(s): [e.g. 2.6.2]
```
"dependencies": {
"@graphql-codegen/cli": "5.0.0",
"@graphql-codegen/typescript-operations": "4.0.1",
"@graphql-codegen/typescript-react-query": "6.0.0",
"@graphql-eslint/eslint-plugin": "3.20.1",
"@graphql-typed-document-node/core": "3.2.0",
"@tanstack/eslint-plugin-query": "4.34.1",
"@tanstack/react-query": "5.17.19",
```
Codegen Config File
```
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
overwrite: true,
schema: '../schema.graphql',
reactQueryVersion: 5,
documents: 'src/**/*.graphql',
generates: {
'src/generated/generated.ts': {
plugins: ['typescript', 'typescript-operations', 'typescript-react-query'],
config: {
fetcher: '../fetcher#fetcher',
namingConvention: {
enumValues: 'keep',
},
},
},
},
};
export default config;
```
### Additional context
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.