Cannot return null for non-nullable field when throwing error #1568
Replies: 4 comments
-
@erikmellum did you find a solution for this? I am using
@MichalLytek do you have an idea here? |
Beta Was this translation helpful? Give feedback.
-
Does it happen only with I'm not sure if we should throw |
Beta Was this translation helpful? Give feedback.
-
@MichalLytek this happens with regular Error as well. @p0thi no I haven't solved this problem yet. It is very important but other priorities have limited my time on this. |
Beta Was this translation helpful? Give feedback.
-
Please create a minimal reproducible code example repository then. |
Beta Was this translation helpful? Give feedback.
-
Describe the issue
When I throw an error in a mutation, the custom error is being discarded in favor of "cannot return null for non-nullable field". I suspect I am doing something wrong, but I do not see in the documentation what the problem is. I am hoping that some guidance can be provided, with hopes that this will also help someone else in the future.
When I run this, the graphql error formatter is seeing:
'Cannot return null for non-nullable field Mutation.createTimeOffRequest.'
Beta Was this translation helpful? Give feedback.
All reactions