Class DefaultExecutionGraphQlResponse.Builder<B extends DefaultExecutionGraphQlResponse.Builder<B,R>, R extends ExecutionGraphQlResponse>

java.lang.Object
org.springframework.graphql.support.DefaultExecutionGraphQlResponse.Builder<B,R>
Type Parameters:
B - the builder type
R - the response type
Direct Known Subclasses:
RSocketGraphQlResponse.Builder, WebGraphQlResponse.Builder
Enclosing class:
DefaultExecutionGraphQlResponse

public abstract static class DefaultExecutionGraphQlResponse.Builder<B extends DefaultExecutionGraphQlResponse.Builder<B,R>, R extends ExecutionGraphQlResponse> extends Object
Builder to transform the response's ExecutionResult.
Since:
1.0.0
Author:
Rossen Stoyanchev
  • Constructor Details

    • Builder

      protected Builder(R original)
  • Method Details

    • data

      Set the data of the GraphQL execution result.
      Parameters:
      data - the execution result data
      Returns:
      the current builder
    • errors

      public DefaultExecutionGraphQlResponse.Builder<B,R> errors(@Nullable List<GraphQLError> errors)
      Set the errors of the GraphQL execution result.
      Parameters:
      errors - the execution result errors
      Returns:
      the current builder
    • extensions

      public DefaultExecutionGraphQlResponse.Builder<B,R> extensions(@Nullable Map<Object,Object> extensions)
      Set the extensions of the GraphQL execution result.
      Parameters:
      extensions - the execution result extensions
      Returns:
      the current builder
    • build

      public R build()
      Build the response with the transformed ExecutionResult.
    • build

      protected abstract R build(R original, ExecutionResult newResult)
      Subclasses to create the specific response instance.
      Parameters:
      original - the original response instance
      newResult - the new execution result for this response