70
70
import graphql .schema .GraphQLTypeVisitor ;
71
71
import graphql .schema .GraphQLTypeVisitorStub ;
72
72
import graphql .schema .GraphQLUnionType ;
73
+ import graphql .schema .InputValueWithState ;
73
74
import graphql .schema .SchemaTransformer ;
74
75
import graphql .schema .TypeResolver ;
75
76
import graphql .schema .idl .DirectiveInfo ;
94
95
import static graphql .Assert .assertNotNull ;
95
96
import static graphql .parser .ParserEnvironment .newParserEnvironment ;
96
97
import static graphql .schema .GraphQLArgument .newArgument ;
98
+ import static graphql .schema .GraphQLNonNull .nonNull ;
97
99
import static graphql .schema .GraphQLTypeUtil .unwrapNonNull ;
98
100
import static graphql .schema .GraphQLTypeUtil .unwrapNonNullAs ;
99
101
import static graphql .schema .GraphQLTypeUtil .unwrapOneAs ;
@@ -260,16 +262,6 @@ public TraversalControl visitGraphQLFieldDefinition(GraphQLFieldDefinition graph
260
262
261
263
@ Override
262
264
public TraversalControl visitGraphQLDirective (GraphQLDirective graphQLDirective , TraverserContext <GraphQLSchemaElement > context ) {
263
- if (Directives .DEPRECATED_DIRECTIVE_DEFINITION .getName ().equals (graphQLDirective .getName ())) {
264
- GraphQLArgument reason = newArgument ().name ("reason" )
265
- .type (Scalars .GraphQLString )
266
- .clearValue ().build ();
267
- GraphQLDirective newElement = graphQLDirective .transform (builder -> {
268
- builder .description (null ).argument (reason );
269
- });
270
- changeNode (context , newElement );
271
- return TraversalControl .ABORT ;
272
- }
273
265
if (DirectiveInfo .isGraphqlSpecifiedDirective (graphQLDirective .getName ())) {
274
266
return TraversalControl .ABORT ;
275
267
}
@@ -285,7 +277,8 @@ public TraversalControl visitGraphQLAppliedDirective(GraphQLAppliedDirective gra
285
277
if (Directives .DEPRECATED_DIRECTIVE_DEFINITION .getName ().equals (graphQLDirective .getName ())) {
286
278
GraphQLAppliedDirectiveArgument reason = GraphQLAppliedDirectiveArgument .newArgument ().name ("reason" )
287
279
.type (Scalars .GraphQLString )
288
- .clearValue ().build ();
280
+ .clearValue ()
281
+ .build ();
289
282
GraphQLAppliedDirective newElement = graphQLDirective .transform (builder -> {
290
283
builder .description (null ).argument (reason );
291
284
});
@@ -918,7 +911,7 @@ private static GraphQLType fromTypeToGraphQLType(Type type, GraphQLSchema schema
918
911
graphql .Assert .assertNotNull (graphQLType , "Schema must contain type %s" , typeName );
919
912
return graphQLType ;
920
913
} else if (type instanceof NonNullType ) {
921
- return GraphQLNonNull . nonNull (fromTypeToGraphQLType (TypeUtil .unwrapOne (type ), schema ));
914
+ return nonNull (fromTypeToGraphQLType (TypeUtil .unwrapOne (type ), schema ));
922
915
} else if (type instanceof ListType ) {
923
916
return GraphQLList .list (fromTypeToGraphQLType (TypeUtil .unwrapOne (type ), schema ));
924
917
} else {
0 commit comments