diff --git a/src/main/java/graphql/ExecutionResult.java b/src/main/java/graphql/ExecutionResult.java
index e3715ee55..c05251ecc 100644
--- a/src/main/java/graphql/ExecutionResult.java
+++ b/src/main/java/graphql/ExecutionResult.java
@@ -3,6 +3,7 @@
import java.util.List;
import java.util.Map;
+import java.util.function.Consumer;
/**
* This simple value class represents the result of performing a graphql query.
@@ -34,7 +35,7 @@ public interface ExecutionResult {
* See : https://graphql.github.io/graphql-spec/June2018/#sec-Data
*
* @return true if the entry "data" should be present in the result
- * false otherwise
+ * false otherwise
*/
boolean isDataPresent();
@@ -54,4 +55,98 @@ public interface ExecutionResult {
* @return a map of the result that strictly follows the spec
*/
Map toSpecification();
+
+
+ /**
+ * This helps you transform the current {@link ExecutionResult} object into another one by starting a builder with all
+ * the current values and allows you to transform it how you want.
+ *
+ * @param builderConsumer the consumer code that will be given a builder to transform
+ *
+ * @return a new {@link ExecutionResult} object based on calling build on that builder
+ */
+ default ExecutionResult transform(Consumer> builderConsumer) {
+ Builder> builder = newExecutionResult().from(this);
+ builderConsumer.accept(builder);
+ return builder.build();
+ }
+
+ /**
+ * @return a builder that allows you to build a new execution result
+ */
+ static Builder> newExecutionResult() {
+ return ExecutionResultImpl.newExecutionResult();
+ }
+
+ interface Builder> {
+
+ /**
+ * Sets values into the builder based on a previous {@link ExecutionResult}
+ *
+ * @param executionResult the previous {@link ExecutionResult}
+ *
+ * @return the builder
+ */
+ B from(ExecutionResult executionResult);
+
+ /**
+ * Sets new data into the builder
+ *
+ * @param data the data to use
+ *
+ * @return the builder
+ */
+ B data(Object data);
+
+ /**
+ * Sets error list as the errors for this builder
+ *
+ * @param errors the errors to use
+ *
+ * @return the builder
+ */
+ B errors(List errors);
+
+ /**
+ * Adds the error list to any existing the errors for this builder
+ *
+ * @param errors the errors to add
+ *
+ * @return the builder
+ */
+ B addErrors(List errors);
+
+ /**
+ * Adds the error to any existing the errors for this builder
+ *
+ * @param error the error to add
+ *
+ * @return the builder
+ */
+ B addError(GraphQLError error);
+
+ /**
+ * Sets the extension map for this builder
+ *
+ * @param extensions the extensions to use
+ *
+ * @return the builder
+ */
+ B extensions(Map