xiaoliu

Results 5 comments of xiaoliu

The reason why the `offset` is nullable. `Kind` is import from `graphql` ![image](https://user-images.githubusercontent.com/21993215/180193981-4aa8d093-6273-4be5-aade-73e61e20ae2f.png)

> 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`