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.
It is quite possible that you are right, and that in all cases, only one error should be reported per field.
The part of the spec you are quoting does not say that.
The part of the spec you are quoting is explicitly about the situation of adding a nullability violation error. That is, if you have a field that is marked non_null in the schema, but you return an error for it, then this is also technically a second error: the result is nil for a field marked non_null. However the spec is saying not to add that second error.
I realize it contains the sentence: "That is, only one error should be added to the errors list per field." however given the context, I don't think it is clear that this is about all errors on all fields in all cases, and not just a comment about the specific extra error addressed in that situation. Are you able to find a clearer statement elsewhere in the spec about error counts per field?
I may be misunderstanding something, but the error response behaviour in Absinthe appears to contradict the GraphQL spec. In https://github.com/absinthe-graphql/absinthe/blob/master/guides/errors.md it is stated that:
However, in the GraphQL specification (http://spec.graphql.org/June2018/#sec-Errors-and-Non-Nullability) the expected behaviour is stated as follows:
Environment
The erroneous behaviour is documented behaviour with the present HEAD of master: https://github.com/absinthe-graphql/absinthe/blob/master/guides/errors.md
Expected behavior
A maximum of a single error should be populated per field as per the GraphQL spec.
Actual behavior
Any number of errors applicable for a given field is returned.
The text was updated successfully, but these errors were encountered: