Closed jasonlaw closed 3 years ago
Of course it is important for output types. [Null] signals that field value (like string) can be null, its type appears in SchemaDoc as 'String', without bang. Without [Null] it would be 'String!', means value guaranteed to be not null. And if your resolver returns null, the engine will (should) catch it and signal server error, failure to follow contract.
Not sure if that is bug or not, I suppose the email cannot be null in this case right?
yep, looks like a bug, the engine supposed to catch it and return error. Is there errors node in response? On the other hand, it should be more like your code's responsibility to never return null, the engine is an extra enforcing check over your code. It might be argued that often it's better return some data to the client than simply a server error. But error should be returned anyway in addition to some data.
There's no error nodes in the response. That's why I was confused with the annotation.
ok, lets register it as a bug, will fix it
should be fixed now
tested ok. thanks!
Hi @rivantsov ,
May I know is the Null annotation only useful for input type? For output fields, I don't see any different with or without it, I could be wrong.
Thanks!