dotansimha / dotansimha/graphql-code-generator-community
CSharp plugin - Support additional configuration to specify "value types"
- Dominant language
- TypeScript
- Stars
- 137
- Forks
- 195
- Avg merge
- 6h 20m
- Merged PRs (30d)
- 16
Description
The value type mapping file is internal to the csharp plugin, this means that there is no way to add additional scalar types that map correctly when they are optional.
A concrete example is to use `DateTimeOffset` (which is preferable when representing timestamps) instead of `DateTime`.
Due to the way that the plugin works, `DateTimeOffset` would not be detected as a value type and so, for optional fields, the generated C# will not include the nullable flag, making it break on deserialization if `null` were provided.
In order to support other value types it would be good to be able to specify "value types" as a configuration option, then the implementation is protected against any other scalar types people care to add.
For our scenario, using `DateTime` as a workaround works, but is not preferable.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.