diff --git a/src/main/java/graphql/language/DirectivesContainer.java b/src/main/java/graphql/language/DirectivesContainer.java index 3acd7f55b7..a306fa7014 100644 --- a/src/main/java/graphql/language/DirectivesContainer.java +++ b/src/main/java/graphql/language/DirectivesContainer.java @@ -57,6 +57,11 @@ default List getDirectives(String directiveName) { * @return true if the AST node contains one or more directives by the specified name */ default boolean hasDirective(String directiveName) { - return !getDirectives(directiveName).isEmpty(); + for (Directive d : getDirectives()) { + if (d.getName().equals(directiveName)) { + return true; + } + } + return false; } }