Closed
Description
Which packages are impacted by your issue?
@graphql-codegen/cli
Describe the bug
I want to prefice this by saying it might be a feature request, depending on how you look at it.
When using @graphql-codegen/cli
with preset: ‘client’
and documentMode: ‘string’
, the generated class TypedDocumentString
is incompatible with the typescript options noImplicitOverride
and exactOptionalPropertyChecks
.
There is a workaround which is to disable those two rules, but since you cannot (as far as I can tell) create typescript rules specific to certain files, you have to disable the rules for the entire project.
Your Example Website or App
https://github.com/vruffer/graphql-strict-ts-error
Steps to Reproduce the Bug or Issue
- Clone repo
- Run
yarn install
- Run
yarn codegen
- Run
yarn check
Expected behavior
I expected the generated typescript to be valid with the strictest settings possible
Screenshots or Videos
No response
Platform
- OS: MacOS
- NodeJS: 20.14.0
graphql
version: 16.9.0@graphql-codegen/cli
version: 5.0.2
Codegen Config File
{
overwrite: true,
generates: {
'./src/gql/': {
schema: ['./src/schema.graphql'],
preset: 'client',
config: {
documentMode: 'string',
},
documents: ['./src/operations.ts'],
},
},
}
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels