Interface GraphqlErrorHandler

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@UnstableApi @FunctionalInterface public interface GraphqlErrorHandler
A handler that maps ExecutionResult.getErrors() or the specified Throwable to an HttpResponse.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable com.linecorp.armeria.common.HttpResponse
    handle(com.linecorp.armeria.server.ServiceRequestContext ctx, graphql.ExecutionInput input, graphql.ExecutionResult result, @Nullable Throwable cause)
    Maps ExecutionResult.getErrors() or the specified Throwable to an HttpResponse.
    of()
    Return the default GraphqlErrorHandler.
    Returns a composed GraphqlErrorHandler that applies this first and the specified other later if this returns null.
  • Method Details

    • of

      static GraphqlErrorHandler of()
      Return the default GraphqlErrorHandler.
    • handle

      @Nullable @Nullable com.linecorp.armeria.common.HttpResponse handle(com.linecorp.armeria.server.ServiceRequestContext ctx, graphql.ExecutionInput input, graphql.ExecutionResult result, @Nullable @Nullable Throwable cause)
      Maps ExecutionResult.getErrors() or the specified Throwable to an HttpResponse.
    • orElse

      default GraphqlErrorHandler orElse(GraphqlErrorHandler other)
      Returns a composed GraphqlErrorHandler that applies this first and the specified other later if this returns null.