graphql-code-generator
graphql-code-generator copied to clipboard
Client preset, generated code with `documentMode: "string"` results in ts(4114) noImplicitOverride error
Which packages are impacted by your issue?
@graphql-codegen/cli
Describe the bug
Generated code fails typescript checks when noImplicitOverride is set to true in tsconfig
$ /project/workspace/node_modules/.bin/tsc
src/graphql/graphql.ts:55:3 - error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'String'.
55 toString(): string & DocumentTypeDecoration<TResult, TVariables> {
~~~~~~~~
Found 1 error in src/graphql/graphql.ts:55
Your Example Website or App
https://codesandbox.io/p/devbox/clever-cloud-nzr6nq
Steps to Reproduce the Bug or Issue
- Enable noImplicitOverride in tsconfig.json
- Run
yarn codegen - Run
yarn tsc
Expected behavior
No errors
Screenshots or Videos

Platform
@graphql-codegen/*version(s): 5.0.6
Codegen Config File
import { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = { schema: "schema.graphql", documents: "./src/document.ts", ignoreNoDocuments: true, generates: { "./src/graphql/": { preset: "client", config: { // Error not present when this is commented out documentMode: "string", }, }, }, };
export default config;
Additional context
No response