Skip to content

Commit c2906a4

Browse files
committed
Stop string spread
1 parent 1ce7d99 commit c2906a4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/graphql/schema/validation/DeprecatedInputObjectAndArgumentsAreValid.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package graphql.schema.validation;
22

3+
import graphql.Directives;
34
import graphql.Internal;
45
import graphql.schema.GraphQLAppliedDirective;
56
import graphql.schema.GraphQLArgument;
@@ -26,7 +27,7 @@ public class DeprecatedInputObjectAndArgumentsAreValid extends GraphQLTypeVisito
2627
@Override
2728
public TraversalControl visitGraphQLInputObjectField(GraphQLInputObjectField inputObjectField, TraverserContext<GraphQLSchemaElement> context) {
2829
// There can only be at most one @deprecated, because it is not a repeatable directive
29-
GraphQLAppliedDirective deprecatedDirective = inputObjectField.getAppliedDirective("deprecated");
30+
GraphQLAppliedDirective deprecatedDirective = inputObjectField.getAppliedDirective(Directives.DEPRECATED_DIRECTIVE_DEFINITION.getName());
3031

3132
if (deprecatedDirective != null && GraphQLTypeUtil.isNonNull(inputObjectField.getType()) && !inputObjectField.hasSetDefaultValue()) {
3233
GraphQLInputObjectType inputObjectType = (GraphQLInputObjectType) context.getParentNode();
@@ -42,7 +43,7 @@ public TraversalControl visitGraphQLInputObjectField(GraphQLInputObjectField inp
4243
@Override
4344
public TraversalControl visitGraphQLArgument(GraphQLArgument argument, TraverserContext<GraphQLSchemaElement> context) {
4445
// There can only be at most one @deprecated, because it is not a repeatable directive
45-
GraphQLAppliedDirective deprecatedDirective = argument.getAppliedDirective("deprecated");
46+
GraphQLAppliedDirective deprecatedDirective = argument.getAppliedDirective(Directives.DEPRECATED_DIRECTIVE_DEFINITION.getName());
4647

4748
if (deprecatedDirective != null && GraphQLTypeUtil.isNonNull(argument.getType()) && !argument.hasSetDefaultValue()) {
4849
if (context.getParentNode() instanceof GraphQLFieldDefinition) {

0 commit comments

Comments
 (0)