1717
1818import graphql .annotations .GraphQLFieldDefinitionWrapper ;
1919import graphql .annotations .annotationTypes .GraphQLRelayMutation ;
20- import graphql .annotations .annotationTypes .GraphQLType ;
2120import graphql .annotations .connection .GraphQLConnection ;
2221import graphql .annotations .processor .ProcessingElementsContainer ;
2322import graphql .annotations .processor .exceptions .CannotCastMemberException ;
4746import java .util .List ;
4847import java .util .Map ;
4948import java .util .stream .Collectors ;
50-
49+ import graphql . schema . GraphQLType ;
5150import static graphql .annotations .processor .util .ObjectUtil .getAllFields ;
5251import static graphql .annotations .processor .util .ReflectionKit .newInstance ;
5352import static graphql .schema .GraphQLFieldDefinition .newFieldDefinition ;
@@ -73,7 +72,7 @@ public GraphQLFieldRetriever() {
7372 this (new GraphQLObjectInfoRetriever (), new BreadthFirstSearch (new GraphQLObjectInfoRetriever ()), new ParentalSearch (new GraphQLObjectInfoRetriever ()), new DataFetcherConstructor ());
7473 }
7574
76- public List <GraphQLFieldDefinition > getExtensionFields (Class <?> object , List <String > fieldsDefined , ProcessingElementsContainer container ) throws CannotCastMemberException {
75+ public List <GraphQLFieldDefinition > getExtensionFields (Class <?> object , List <String > definedFields , ProcessingElementsContainer container ) throws CannotCastMemberException {
7776 List <GraphQLFieldDefinition > fields = new ArrayList <>();
7877 if (container .getExtensionsTypeRegistry ().containsKey (object )) {
7978 for (Class <?> aClass : container .getExtensionsTypeRegistry ().get (object )) {
@@ -82,15 +81,15 @@ public List<GraphQLFieldDefinition> getExtensionFields(Class<?> object, List<Str
8281 continue ;
8382 }
8483 if (breadthFirstSearch .isFound (method )) {
85- addExtensionField (getField (method , container ), fields , fieldsDefined );
84+ addExtensionField (getField (method , container ), fields , definedFields );
8685 }
8786 }
8887 for (Field field : getAllFields (aClass ).values ()) {
8988 if (Modifier .isStatic (field .getModifiers ())) {
9089 continue ;
9190 }
9291 if (parentalSearch .isFound (field )) {
93- addExtensionField (getField (field , container ), fields , fieldsDefined );
92+ addExtensionField (getField (field , container ), fields , definedFields );
9493 }
9594 }
9695 }
@@ -123,7 +122,7 @@ public GraphQLFieldDefinition getField(Field field, ProcessingElementsContainer
123122 builder .name (new FieldNameBuilder (field ).build ());
124123 TypeFunction typeFunction = getTypeFunction (field , container );
125124
126- graphql . schema . GraphQLType outputType = typeFunction .buildType (field .getType (), field .getAnnotatedType (), container );
125+ GraphQLType outputType = typeFunction .buildType (field .getType (), field .getAnnotatedType (), container );
127126 boolean isConnection = ConnectionUtil .isConnection (field , outputType );
128127 if (isConnection ) {
129128 outputType = getGraphQLConnection (field , outputType , container .getRelay (), container .getTypeRegistry ());
@@ -149,7 +148,7 @@ public GraphQLInputObjectField getInputField(Field field, ProcessingElementsCont
149148 GraphQLInputObjectField .Builder builder = newInputObjectField ();
150149 builder .name (new FieldNameBuilder (field ).build ());
151150 TypeFunction typeFunction = getTypeFunction (field , container );
152- graphql . schema . GraphQLType graphQLType = typeFunction .buildType (true ,field .getType (), field .getAnnotatedType (), container );
151+ GraphQLType graphQLType = typeFunction .buildType (true ,field .getType (), field .getAnnotatedType (), container );
153152 return builder .type ((GraphQLInputType ) graphQLType ).description (new DescriptionBuilder (field ).build ()).build ();
154153 }
155154
@@ -170,7 +169,7 @@ private void handleConnectionArgument(ProcessingElementsContainer container, Gra
170169 }
171170
172171 private TypeFunction getTypeFunction (Method method , ProcessingElementsContainer container ) {
173- GraphQLType annotation = method .getAnnotation (GraphQLType .class );
172+ graphql . annotations . annotationTypes . GraphQLType annotation = method .getAnnotation (graphql . annotations . annotationTypes . GraphQLType .class );
174173 TypeFunction typeFunction = container .getDefaultTypeFunction ();
175174
176175 if (annotation != null ) {
@@ -200,7 +199,7 @@ private GraphQLFieldDefinition buildRelayMutation(Method method, ProcessingEleme
200199
201200
202201 private TypeFunction getTypeFunction (Field field , ProcessingElementsContainer container ) {
203- GraphQLType annotation = field .getAnnotation (GraphQLType .class );
202+ graphql . annotations . annotationTypes . GraphQLType annotation = field .getAnnotation (graphql . annotations . annotationTypes . GraphQLType .class );
204203
205204 TypeFunction typeFunction = container .getDefaultTypeFunction ();
206205
@@ -227,9 +226,9 @@ private GraphQLOutputType internalGetGraphQLConnection(AccessibleObject field, G
227226 return getActualType (relay .connectionType (connectionName , edgeType , Collections .emptyList ()), typeRegistry );
228227 }
229228
230- private void addExtensionField (GraphQLFieldDefinition gqlField , List <GraphQLFieldDefinition > fields , List <String > fieldsDefined ) {
231- if (!fieldsDefined .contains (gqlField .getName ())) {
232- fieldsDefined .add (gqlField .getName ());
229+ private void addExtensionField (GraphQLFieldDefinition gqlField , List <GraphQLFieldDefinition > fields , List <String > definedFields ) {
230+ if (!definedFields .contains (gqlField .getName ())) {
231+ definedFields .add (gqlField .getName ());
233232 fields .add (gqlField );
234233 } else {
235234 throw new GraphQLAnnotationsException ("Duplicate field found in extension : " + gqlField .getName (), null );
0 commit comments