@@ -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,18 @@ 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 ()).forEach (x -> {
53+ if (!x .isSynthetic ()) {
54+ builder .argument (directiveArgumentCreator .getArgument (x , annotatedClass ));
55+ }
56+ });
5457 }
5558
56-
5759 private Introspection .DirectiveLocation [] getValidLocations (Class <?> annotatedClass ) {
5860 DirectiveLocations directiveLocationsAnnotation = annotatedClass .getAnnotation (DirectiveLocations .class );
5961 if (directiveLocationsAnnotation != null ) {
6062 return directiveLocationsAnnotation .value ();
6163 }
6264 return null ;
6365 }
64-
6566}
0 commit comments