@@ -30,7 +30,6 @@ public class DataFetcherResult<T> {
3030 private final T data ;
3131 private final List <GraphQLError > errors ;
3232 private final Object localContext ;
33- private final boolean mapRelativeErrors ;
3433
3534 /**
3635 * Creates a data fetcher result
@@ -43,14 +42,13 @@ public class DataFetcherResult<T> {
4342 @ Internal
4443 @ Deprecated
4544 public DataFetcherResult (T data , List <GraphQLError > errors ) {
46- this (data , errors , null , false );
45+ this (data , errors , null );
4746 }
4847
49- private DataFetcherResult (T data , List <GraphQLError > errors , Object localContext , boolean mapRelativeErrors ) {
48+ private DataFetcherResult (T data , List <GraphQLError > errors , Object localContext ) {
5049 this .data = data ;
5150 this .errors = ImmutableList .copyOf (assertNotNull (errors ));
5251 this .localContext = localContext ;
53- this .mapRelativeErrors = mapRelativeErrors ;
5452 }
5553
5654 /**
@@ -83,20 +81,6 @@ public Object getLocalContext() {
8381 return localContext ;
8482 }
8583
86- /**
87- * When this returns true, the data fetching code will map this error as being a relative error from the existing field.
88- * <p>
89- * This is useful when you are calling a down stream graphql system and you want to make the errors appear to be from a point
90- * relative to the currently executing field.
91- * <p>
92- * By default this behavior is off
93- *
94- * @return true if relative error mapping should occur.
95- */
96- public boolean isMapRelativeErrors () {
97- return mapRelativeErrors ;
98- }
99-
10084 /**
10185 * This helps you transform the current DataFetcherResult into another one by starting a builder with all
10286 * the current values and allows you to transform it how you want.
@@ -126,13 +110,11 @@ public static class Builder<T> {
126110 private T data ;
127111 private Object localContext ;
128112 private final List <GraphQLError > errors = new ArrayList <>();
129- private boolean mapRelativeErrors = false ;
130113
131114 public Builder (DataFetcherResult <T > existing ) {
132115 data = existing .getData ();
133116 localContext = existing .getLocalContext ();
134117 errors .addAll (existing .getErrors ());
135- mapRelativeErrors = existing .isMapRelativeErrors ();
136118 }
137119
138120 public Builder (T data ) {
@@ -157,11 +139,6 @@ public Builder<T> error(GraphQLError error) {
157139 return this ;
158140 }
159141
160- public Builder <T > mapRelativeErrors (boolean mapRelativeErrors ) {
161- this .mapRelativeErrors = mapRelativeErrors ;
162- return this ;
163- }
164-
165142 /**
166143 * @return true if there are any errors present
167144 */
@@ -175,7 +152,7 @@ public Builder<T> localContext(Object localContext) {
175152 }
176153
177154 public DataFetcherResult <T > build () {
178- return new DataFetcherResult <>(data , errors , localContext , mapRelativeErrors );
155+ return new DataFetcherResult <>(data , errors , localContext );
179156 }
180157 }
181158}
0 commit comments