Fork me on GitHub

I have a schema that looks like

{:queries {:orb {:type Orb
                 :args {:name {:type String}}
                 :resolve :orb}}
 :objects {:Orb {:id {:type (non-null ID)}, ...}}}
But if I make a query to orb like so:
orb(name: $name) {
and my resolver returns nil instead of a map, I get this error:
[{"message":"Non-nullable field was null.","locations":[{"line":4,"column":5}],"path":["orb","id"]}]
I assumed that if the query response itself was nullable, even though one of the inner fields Iā€™m querying over is non-nullable, I could return a null instead of the entire object and that would be legit. Am I misunderstanding how GraphQL works?


Please add a Lacinia issue; if it is behaving that way, it is a bug.

šŸ‘ 3