You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the field returns null because of an error which has already been added to the "errors" list in the response, the "errors" list must not be further affected. That is, only one error should be added to the errors list per field.
That means, that when non_null field has nil value, but there is already an error related to that field, then "Cannot return null for non-nullable field" error should not be propagated.
For example, if query
field:user,non_null(:user)doarg:id,non_null(:id)resolvefnargs,resolution->caseauthorize(args,resolution.context.current_user)do:ok# next steps{:ok,user}:error{:error,:unauthorized}endend
returns {:error, :unauthorized} then errors list should contain only one error in response:
The text was updated successfully, but these errors were encountered:
virtual-light
changed the title
`"Cannot return null for non-nullable field" present when error was specified
"Cannot return null for non-nullable field" present when error was specified
Nov 11, 2019
Environment
Expected behavior
According to current GQL specification paragraph 6.4.4 and working draft of new GQL specification paragraph 6.4.4.
That means, that when
non_null
field has nil value, but there is already an error related to that field, then"Cannot return null for non-nullable field"
error should not be propagated.For example, if query
returns
{:error, :unauthorized}
then errors list should contain only one error in response:Actual behavior
"Cannot return null for non-nullable field"
present in errors list in response.The text was updated successfully, but these errors were encountered: