xiaoliu
xiaoliu
The reason why the `offset` is nullable. `Kind` is import from `graphql` 
> weird. it's `undefined` only when I debug it.
the real reason: ```ts const addOptionalSign = !this.config.avoidOptionals.inputValue && (originalFieldNode.type.kind !== Kind.NON_NULL_TYPE || (!this.config.avoidOptionals.defaultValue && node.defaultValue !== undefined)); // node.defaultValue == { kind: 'IntValue', value: '0' } ``` https://github.com/dotansimha/graphql-code-generator/blob/master/packages/plugins/typescript/typescript/src/visitor.ts#L297 ###...
```yaml generates: types.ts: plugins: - typescript config: avoidOptionals: defaultValue: true ``` set `avoidOptionals.defaultValue` to `true`