18
18
import graphql .execution .MergedField ;
19
19
import graphql .introspection .Introspection ;
20
20
import graphql .language .Field ;
21
- import graphql .language .FragmentDefinition ;
22
21
import graphql .language .InlineFragment ;
23
22
import graphql .language .SelectionSet ;
24
23
import graphql .language .TypeName ;
27
26
import graphql .schema .GraphQLTypeUtil ;
28
27
import java .util .ArrayList ;
29
28
import java .util .Collection ;
30
- import java .util .Collections ;
31
29
import java .util .HashMap ;
32
30
import java .util .List ;
33
31
import java .util .Map ;
@@ -63,7 +61,7 @@ public CompletionStage<List<DataFetcherResult<Object>>> load(List<DataFetchingEn
63
61
GraphQLContext graphQLContext = dfeTemplate .getContext ();
64
62
65
63
List <Map <String , Object >> representations = dataFetchingEnvironments .stream ()
66
- .map (dataFetchingEnvironment -> createRepresentation ( dataFetchingEnvironment ) )
64
+ .map (this :: createRepresentation )
67
65
.collect (Collectors .toList ());
68
66
69
67
List <InlineFragment > inlineFragments = new ArrayList <>();
@@ -166,9 +164,6 @@ private Map<String, Object> createRepresentation(
166
164
167
165
/**
168
166
* builds mapping of fieldName-alias. If fieldName has no alias, it will be mapped to itself.
169
- *
170
- * @param dataFetchingEnvironment
171
- * @return
172
167
*/
173
168
private Map <String , String > buildkeyToAliasMap (DataFetchingEnvironment dataFetchingEnvironment ) {
174
169
MergedField parentField = dataFetchingEnvironment .getExecutionStepInfo ().getParent ().getField ();
@@ -178,7 +173,7 @@ private Map<String, String> buildkeyToAliasMap(DataFetchingEnvironment dataFetch
178
173
.values ()
179
174
.stream ()
180
175
.filter (field -> this .representationFieldTemplate .contains (field .getName ()))
181
- .collect (Collectors .toMap (field -> field . getName () , field -> field .getAlias () == null ? field .getName () : field .getAlias ()));
176
+ .collect (Collectors .toMap (Field :: getName , field -> field .getAlias () == null ? field .getName () : field .getAlias ()));
182
177
}
183
178
184
179
}
0 commit comments