Support for Nullable reference types
See original GitHub issueHey there! This is such an awesome project, thanks a lot for creating it and choosing MIT for the license!
I just cloned and ran the console app against our backend and noticed value types are annotated with question marks in the generated types, i.e. they are nullable when the schema says they are.
I’d love to see the same type annotation in the C# types for reference types, thanks to C# 8.0 supporting that. This should probably be an option, as I’m sure not everyone wants to switch to C# 8 for their project just yet 😄 The generated output file should probably enclose the whole source with #nullable enable
and #nullable restore
- just in case a user is using C# 8 but not yet turning on nullable ref types for everything.
I am happy to raise a PR for this, but it will be a couple of weeks most likely until I can get to it.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Forgot the strings and other reference types. These should be marked with question mark in C# 8 to say explicitly they are nullable. I’ll fix that too. Of course with optional setting as it would break compilation for older compiler versions.
I just updated and ran some of my queries without any problem! All input classes have the proper annotation and are wrapped in
#nullable
(enable
, thendisable
).Thanks a lot for the quick changes ❤️