All Downloads are FREE. Search and download functionalities are using the official Maven repository.

graphql.kickstart.execution.GraphQLQueryResult Maven / Gradle / Ivy

package graphql.kickstart.execution;

import static java.util.Collections.emptyList;

import graphql.ExecutionResult;
import java.util.List;

public interface GraphQLQueryResult {

  static GraphQLSingleQueryResult create(ExecutionResult result) {
    return new GraphQLSingleQueryResult(new DecoratedExecutionResult(result));
  }

  static GraphQLBatchedQueryResult create(List results) {
    return new GraphQLBatchedQueryResult(results);
  }

  static GraphQLErrorQueryResult createError(int statusCode, String message) {
    return new GraphQLErrorQueryResult(statusCode, message);
  }

  boolean isBatched();

  boolean isAsynchronous();

  default DecoratedExecutionResult getResult() {
    return null;
  }

  default List getResults() {
    return emptyList();
  }

  default boolean isError() {
    return false;
  }

  default int getStatusCode() {
    return 200;
  }

  default String getMessage() {
    return null;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy