File tree 1 file changed +9
-2
lines changed
src/test/java/graphql/annotations
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 31
31
import graphql .GraphQL ;
32
32
import graphql .annotations .annotationTypes .GraphQLDirectives ;
33
33
import graphql .annotations .annotationTypes .GraphQLField ;
34
+ import graphql .annotations .annotationTypes .GraphQLName ;
34
35
import graphql .annotations .directives .AnnotationsDirectiveWiring ;
35
36
import graphql .annotations .directives .AnnotationsWiringEnvironment ;
36
37
import graphql .annotations .directives .Directive ;
38
+ import graphql .annotations .directives .creation .DirectiveLocations ;
37
39
import graphql .annotations .processor .GraphQLAnnotations ;
38
40
import graphql .annotations .processor .exceptions .GraphQLAnnotationsException ;
39
41
import graphql .introspection .Introspection ;
@@ -135,10 +137,15 @@ public void queryName_noDirectivesProvidedToRegistry_exceptionIsThrown() throws
135
137
GraphQL .newGraphQL (schema ).build ().execute ("query { name }" );
136
138
}
137
139
140
+ @ GraphQLName ("upperCase" )
141
+ @ DirectiveLocations (Introspection .DirectiveLocation .FIELD_DEFINITION )
142
+ public static class UpperCase {
143
+ boolean isActive ;
144
+ }
145
+
138
146
@ Test
139
147
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 );
142
149
GraphQLObjectType object = GraphQLAnnotations .object (Query .class , upperCase );
143
150
GraphQLSchema schema = newSchema ().query (object ).build ();
144
151
You can’t perform that action at this time.
0 commit comments