Open keckrich opened 5 months ago
Hi @keckrich ,
Interesting problem! Looks like a clash in reserved keywords in TypeScript. I talked to someone at the Codegen team about this issue previously but I'm not sure when or what the fix would be 🙂.
Do you mind creating an issue at https://github.com/dotansimha/graphql-code-generator instead please? If it's implemented there, it would just work with the preset in this repo. 🙂
Describe the bug When a schema.graphql file has an interface called Record the types.generated.ts file with throw an error. In my case the first error is with
export type WithIndex<TObject> = TObject & Record<string, any>;
as well as:/** Mapping of interface types */
export type ResolversInterfaceTypes<RefType extends Record<string, unknown>> = ResolversObject<{
To Reproduce
graphql-codegen
Expected behavior I am currently getting around this by manually adding a TypeScriptRecord and updating where Record is called: `export type TypeScriptRecord<K extends string | number | symbol, T> = {
};`
Versions