@@ -36,8 +36,8 @@ public DirectiveCreator(DirectiveArgumentCreator directiveArgumentCreator, Commo
3636
3737 public GraphQLDirective getDirective (Class <?> annotatedClass ) {
3838 GraphQLDirective .Builder builder = newDirective ()
39- .name (commonPropertiesCreator .getName (annotatedClass ))
40- .description (commonPropertiesCreator .getDescription (annotatedClass ));
39+ .name (commonPropertiesCreator .getName (annotatedClass ))
40+ .description (commonPropertiesCreator .getDescription (annotatedClass ));
4141 Introspection .DirectiveLocation [] validLocations = getValidLocations (annotatedClass );
4242 if (validLocations == null || validLocations .length == 0 ) {
4343 throw new GraphQLAnnotationsException ("No valid locations defined on directive" , null );
@@ -49,17 +49,16 @@ public GraphQLDirective getDirective(Class<?> annotatedClass) {
4949 }
5050
5151 private void buildArguments (GraphQLDirective .Builder builder , Class <?> annotatedClass ) {
52- Arrays .stream (annotatedClass .getDeclaredFields ()).forEach (x ->
53- builder .argument (directiveArgumentCreator .getArgument (x , annotatedClass )));
52+ Arrays .stream (annotatedClass .getDeclaredFields ())
53+ .filter (field -> !field .isSynthetic ())
54+ .forEach (field -> builder .argument (directiveArgumentCreator .getArgument (field , annotatedClass )));
5455 }
5556
56-
5757 private Introspection .DirectiveLocation [] getValidLocations (Class <?> annotatedClass ) {
5858 DirectiveLocations directiveLocationsAnnotation = annotatedClass .getAnnotation (DirectiveLocations .class );
5959 if (directiveLocationsAnnotation != null ) {
6060 return directiveLocationsAnnotation .value ();
6161 }
6262 return null ;
6363 }
64-
6564}
0 commit comments