graphql-platform
graphql-platform copied to clipboard
Wrong code generated when passing a C# struct (custom scalar) as required argument
Product
Strawberry Shake
Version
15.1.3
Link to minimal reproduction
https://github.com/ravasior/StrawberryShake_Struct
Steps to reproduce
open file 'TestProject\GetModelId.graphql' and uncomment the last two lines.
What is expected?
the generated code should compile.
What is actually happening?
the generated code fails with: CS0037: Cannot convert null to 'ModelId' because it is a non-nullable value type
the reason being that the Format method contains code testing the argument for null which is not valid for type struct.
Relevant log output
...\TestProject\obj\Debug\net9.0\berry\MyClient.Client.cs(1188,26,1188,30): error CS0037: Cannot convert null to 'ModelId' because it is a non-nullable value type
Additional context
No response
I have the same issue.