DefinitionsGeneratorOptions
interface DefinitionsGeneratorOptions {
emitTypenameField?: boolean
skipResolverArgs?: boolean
defaultScalarType?: string
customScalarTypeMapping?: Record<string, string | {...}
defaultTypeMapping?: Partial<Record<'ID' | 'Boolean' | 'Float' | 'String' | 'Int', string>>
additionalHeader?: string
enumsAsTypes?: boolean
}
Properties
Property | Description |
---|---|
emitTypenameField?: boolean
|
If true, the additional "__typename" field is generated for every object type. By default is false |
skipResolverArgs?: boolean
|
If true, resolvers (query/mutation/etc) are generated as plain fields without arguments. By default is false |
defaultScalarType?: string
|
If provided, specifies a default generated TypeScript type for custom scalars. By default is 'any' |
customScalarTypeMapping?: Record<string, string | {
name: string;
}>
|
If provided, specifies a mapping of types to use for custom scalars By default is undefined |
defaultTypeMapping?: Partial<Record<'ID' | 'Boolean' | 'Float' | 'String' | 'Int', string>>
|
If provided, specifies a mapping of default scalar types (Int, Boolean, ID, Float, String). By default is undefined |
additionalHeader?: string
|
If provided, specifies a custom header to add after the to the output file (eg. for custom type imports or comments) By default is undefined |
enumsAsTypes?: boolean
|
If true, enums are generated as string literal union types. by default is false |