| 11 | import { GenerateContext } from './GenerateContext' |
| 12 | |
| 13 | export class InputField implements Generable { |
| 14 | constructor( |
| 15 | protected readonly field: DMMF.SchemaArg, |
| 16 | protected readonly context: GenerateContext, |
| 17 | protected readonly source?: string, |
| 18 | ) {} |
| 19 | public toTS(): string { |
| 20 | const property = buildInputField(this.field, this.context, this.source) |
| 21 | return ts.stringify(property) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | export function buildInputField(field: DMMF.SchemaArg, context: GenerateContext, source?: string): ts.Property { |
| 26 | const tsType = buildAllFieldTypes(field.inputTypes, context, source) |
nothing calls this directly
no outgoing calls
no test coverage detected