X Tutup
Skip to content

Commit c002698

Browse files
committed
removed transform method on interface
1 parent 1618e53 commit c002698

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

src/main/java/graphql/execution/batched/UnbatchedDataFetcher.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import java.util.ArrayList;
88
import java.util.List;
99

10+
import static graphql.schema.DataFetchingEnvironmentBuilder.newDataFetchingEnvironment;
11+
1012
/**
1113
* Given a normal data fetcher as a delegate,
1214
* uses that fetcher in a batched context by iterating through each source value and calling
@@ -27,8 +29,8 @@ public Object get(DataFetchingEnvironment environment) {
2729
List<Object> results = new ArrayList<>();
2830
for (Object source : sources) {
2931

30-
DataFetchingEnvironment singleEnv = environment
31-
.transform(builder -> builder.source(source));
32+
DataFetchingEnvironment singleEnv = newDataFetchingEnvironment(environment)
33+
.source(source).build();
3234
results.add(delegate.get(singleEnv));
3335
}
3436
return results;

src/main/java/graphql/schema/DataFetchingEnvironment.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,4 @@ public interface DataFetchingEnvironment {
108108
* @return the {@link DataFetchingFieldSelectionSet} for the current operation
109109
*/
110110
DataFetchingFieldSelectionSet getSelectionSet();
111-
112-
113-
/**
114-
* This allows you to transform this DataFetchingEnvironment object into another one.
115-
*
116-
* @param action the action to which a {@link DataFetchingEnvironmentBuilder} is passed
117-
*
118-
* @return a new transformed DataFetchingEnvironment
119-
*/
120-
default DataFetchingEnvironment transform(Consumer<DataFetchingEnvironmentBuilder> action) {
121-
DataFetchingEnvironmentBuilder builder = newDataFetchingEnvironment(this);
122-
action.accept(builder);
123-
return builder.build();
124-
}
125111
}

0 commit comments

Comments
 (0)
X Tutup