Closed
Description
The problem (current behaviour)
When graphQL schema includes String fields having default values with line breaks such as:
someField: String = "Some\nThing"
then the generated TypeScript code will include an invalid line:
someField: z.string().default("Some
Thing").nullish(),
resulting in the following compilation error:
error TS1002: Unterminated string literal.
Expected behaviour
When generating default values, strings should be sanitized and used exactly as they are in the input schema, resulting in the following code being generated instead:
someField: z.string().default("Some\nThing").nullish(),
Metadata
Metadata
Assignees
Labels
No labels