Closed ChrisMH closed 2 years ago
This one is now fixed.
@michaelstaib This is still happening. Here is the SS generated code for a non-nullable instant, it's still checking for null:
private global::System.Object? FormatAlertTime(global::NodaTime.Instant input)
{
if (input is null)
{
throw new global::System.ArgumentNullException(nameof(input));
}
return _instantFormatter.Format(input);
}
12.5.0-preview.15
@ChrisMH do you declare it as a value type?
@runtimeType(name: "global::NodaTime.Instant", valueType: true)
@PascalSenn No
From my schema.extensions.graphql:
extend scalar Instant
@runtimeType(name: "global::NodaTime.Instant")
@serializationType(name: "global::System.String")
I must have missed that, adding the valueType: true works.
Thanks!
StrawberryShake generated formatter is checking null for non-nullable type 11.3.0-preview.6
The SS generated formatter. The bits that are causing an error are
FormatBeforeDate
andFormatSinceDate
, both of which take a non-nullable Instant as input, but checkif(input is null)
Relevant object in my schema:
I have a custom serializer registered for Instant in schema.extensions.graphql:
Here is the code for the serializer:
And it is registered like:
Expected behavior I would expect that the generated code NOT check
is null
since the input is not nullable.