File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/test/java/graphql/annotations Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 3131import graphql .GraphQL ;
3232import graphql .annotations .annotationTypes .GraphQLDirectives ;
3333import graphql .annotations .annotationTypes .GraphQLField ;
34+ import graphql .annotations .annotationTypes .GraphQLName ;
3435import graphql .annotations .directives .AnnotationsDirectiveWiring ;
3536import graphql .annotations .directives .AnnotationsWiringEnvironment ;
3637import graphql .annotations .directives .Directive ;
38+ import graphql .annotations .directives .creation .DirectiveLocations ;
3739import graphql .annotations .processor .GraphQLAnnotations ;
3840import graphql .annotations .processor .exceptions .GraphQLAnnotationsException ;
3941import graphql .introspection .Introspection ;
@@ -135,10 +137,15 @@ public void queryName_noDirectivesProvidedToRegistry_exceptionIsThrown() throws
135137 GraphQL .newGraphQL (schema ).build ().execute ("query { name }" );
136138 }
137139
140+ @ GraphQLName ("upperCase" )
141+ @ DirectiveLocations (Introspection .DirectiveLocation .FIELD_DEFINITION )
142+ public static class UpperCase {
143+ boolean isActive ;
144+ }
145+
138146 @ Test
139147 public void queryName_directivesProvidedToRegistry_wiringIsActivated () throws Exception {
140- GraphQLDirective upperCase = newDirective ().name ("upperCase" ).argument (builder -> builder .name ("isActive" ).type (GraphQLBoolean ))
141- .validLocations (Introspection .DirectiveLocation .FIELD_DEFINITION ).build ();
148+ GraphQLDirective upperCase = GraphQLAnnotations .directive (UpperCase .class );
142149 GraphQLObjectType object = GraphQLAnnotations .object (Query .class , upperCase );
143150 GraphQLSchema schema = newSchema ().query (object ).build ();
144151
You can’t perform that action at this time.
0 commit comments