Skip to content

Errors in a non-nullable field throw exception out of GraphQL.execute() #268

@dllx

Description

@dllx

When an exception (field error) happens during resolution of a field, completeValue is called with a null resolvedValue. If the field is a GraphQLNonNull, that leads to a GraphQLException being thrown which is never caught.

According to the GraphQL spec, 6.4.4 Errors and Nullability (http://facebook.github.io/graphql/#sec-Errors-and-Non-Nullability), the null value should be propagated up to the parent field in this case (and if that is non-nullable, up again until ultimately a null value under the data key of the response object), without adding additional errors to the result error list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions