A possible fix for https://github.com/Khan/genqlient/issues/342. More description and discussion in the issue itself.
I am definitely fine for going another approach (reason for draft) if the breaking change is not appropriate.
This PR fixes the issue by changing what type is generated for non-nullable input field types with no default value: for example the added test currently generates:
and after https://github.com/Khan/genqlient/pull/338 this would cause an error during generation as the validation is trying to prevent a type that could cause runtime error by omitting a value for a type for which omitting is not possible.
I have:
[x] Written a clear PR title and description (above)
A possible fix for https://github.com/Khan/genqlient/issues/342. More description and discussion in the issue itself. I am definitely fine for going another approach (reason for draft) if the breaking change is not appropriate.
This PR fixes the issue by changing what type is generated for non-nullable input field types with no default value: for example the added test currently generates:
Previously, it would generate:
and after https://github.com/Khan/genqlient/pull/338 this would cause an error during generation as the validation is trying to prevent a type that could cause runtime error by omitting a value for a type for which omitting is not possible.
I have: