22
33
44import graphql .Internal ;
5+ import graphql .execution .ExecutionContext ;
56import graphql .execution .ExecutionId ;
67import graphql .execution .ExecutionTypeInfo ;
78import graphql .language .Field ;
1011import java .util .List ;
1112import java .util .Map ;
1213
14+ import static graphql .Assert .assertNotNull ;
15+
1316@ SuppressWarnings ("unchecked" )
1417@ Internal
1518public class DataFetchingEnvironmentImpl implements DataFetchingEnvironment {
@@ -26,8 +29,22 @@ public class DataFetchingEnvironmentImpl implements DataFetchingEnvironment {
2629 private final ExecutionId executionId ;
2730 private final DataFetchingFieldSelectionSet selectionSet ;
2831 private final ExecutionTypeInfo fieldTypeInfo ;
29-
30- public DataFetchingEnvironmentImpl (Object source , Map <String , Object > arguments , Object context , Object root , GraphQLFieldDefinition fieldDefinition , List <Field > fields , GraphQLOutputType fieldType , GraphQLType parentType , GraphQLSchema graphQLSchema , Map <String , FragmentDefinition > fragmentsByName , ExecutionId executionId , DataFetchingFieldSelectionSet selectionSet , ExecutionTypeInfo fieldTypeInfo ) {
32+ private ExecutionContext executionContext ;
33+
34+ public DataFetchingEnvironmentImpl (Object source ,
35+ Map <String , Object > arguments ,
36+ Object context ,
37+ Object root ,
38+ GraphQLFieldDefinition fieldDefinition ,
39+ List <Field > fields ,
40+ GraphQLOutputType fieldType ,
41+ GraphQLType parentType ,
42+ GraphQLSchema graphQLSchema ,
43+ Map <String , FragmentDefinition > fragmentsByName ,
44+ ExecutionId executionId ,
45+ DataFetchingFieldSelectionSet selectionSet ,
46+ ExecutionTypeInfo fieldTypeInfo ,
47+ ExecutionContext executionContext ) {
3148 this .source = source ;
3249 this .arguments = arguments ;
3350 this .context = context ;
@@ -41,6 +58,7 @@ public DataFetchingEnvironmentImpl(Object source, Map<String, Object> arguments,
4158 this .executionId = executionId ;
4259 this .selectionSet = selectionSet ;
4360 this .fieldTypeInfo = fieldTypeInfo ;
61+ this .executionContext = assertNotNull (executionContext );
4462 }
4563
4664 @ Override
@@ -123,6 +141,11 @@ public ExecutionTypeInfo getFieldTypeInfo() {
123141 return fieldTypeInfo ;
124142 }
125143
144+ @ Override
145+ public ExecutionContext getExecutionContext () {
146+ return executionContext ;
147+ }
148+
126149 @ Override
127150 public String toString () {
128151 return "DataFetchingEnvironmentImpl{" +
0 commit comments