2

I am using graphql-spring-boot-starter and graphql-java-tools in my API. My custom error handler looks:

@Override
public List<GraphQLError> processErrors(List<GraphQLError> list) {
    return list.stream().map(this::getNested).collect(Collectors.toList());
}

private GraphQLError getNested(GraphQLError error) {

    if (error instanceof ExceptionWhileDataFetching) {
        ExceptionWhileDataFetching exceptionError = (ExceptionWhileDataFetching) error;
        if (exceptionError.getException() instanceof GraphQLError) {
            return (GraphQLError) exceptionError.getException();
        }
    }
    return error;
}

}

How I can set http status?

A.Sidor
  • 257
  • 4
  • 12
  • Looks like it's the same question as https://stackoverflow.com/questions/62085033/error-handling-with-graphql-java-tools-and-graphql-spring-boot-starter/ – etienne-sf Jun 02 '20 at 16:12

0 Answers0