Fork me on GitHub
#graphql
<
2020-06-24
>
aengelberg22:06:07

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) {
		  id
		}
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?

hlship00:06:17

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

šŸ‘ 3