ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.28k stars 748 forks source link

Strawberry Shake says Value cannot be Null if field starts with Underscore and is marked as not Null #4593

Closed meierhoeferjannis closed 2 years ago

meierhoeferjannis commented 2 years ago

Is there an existing issue for this?

Describe the bug

StrawberryShake throws an System.ArgumentNullException when a field starts with an underscore like _id and is marked as not nullable. I already saw the issue #4480 which describes the same behaviour but was solved due to weird gateway behaviour. In the screenshot i attached, you can see that _id has a value so im wondering why i get this exception. Am i missing something ?

Steps to reproduce

I created a short sample project, that reproduces the bug. https://github.com/meierhoeferjannis/SampleProject Just start the SampleProject and set a breakpoint in the Index.razor OnInitializedAsync Method. You will see that result.Errors will contain a StrawberryShake.ClientError with the value cannot be null exception. Then check result.Errors.Extensions.Items[0].value. You will see that the _id field has a value, which is simply getting ignored. (Just like in the screenshot i attached on this issue.

Relevant log output

No response

Additional Context?

grafik

Product

Strawberry Shake

Version

12.4.1

PascalSenn commented 2 years ago

This is fixed in the latest 12.5 previews