Closed zth closed 3 years ago
I was missing something... For anyone else with the same issue: I had explicitly annotated my User
object type like this:
export const UserType: ObjectType<AppContext, User> = t.objectType<User>(...
...and making that annotation nullable made things work, like below:
export const UserType: ObjectType<AppContext, User | null> = t.objectType<User>(...
The reason for annotating this at all was that inference didn't work properly for me at some point. But I realize annotating like that at all is pretty weird.
I have this field:
I'd expect this to work - I haven't marked
UserType
as non-nullable witht.NonNull(UserType)
, but this still errors with:Am I missing something in how this works, or have I found some form of bug?