So, TDLR. GraphQLError: Cannot return null for non-nullable field is thrown with a field reference that is not the correct nulled field.
In my case, I spent hours and hours debugging GraphQLError: Cannot return null for non-nullable field Social__User.id.. And the id was there! Turns out, I returned a null value on another non nullable field on that type and either graphql or apollo indicates the wrong frigging field on the error message!
Apollo client: 2.6.2
Apollo server express 2.6.2
graphql 14.3.1
graphql-tools 4.0.4
We're also seeing this issue. It seems to happen when we dont try/catch something in an async resolver function that then throws.
So, yeah, this is definitely a graphql bug. I reported it there: https://github.com/graphql/graphql-js/issues/1989
Most helpful comment
So, yeah, this is definitely a
graphqlbug. I reported it there: https://github.com/graphql/graphql-js/issues/1989