Skip to content

Commit e5bee84

Browse files
committed
fix(DirectivesAreDefined) stop validating invalid directives
1 parent 9060690 commit e5bee84

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/graphql/static_validation/rules/directives_are_defined.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ def validate(context)
1515
def validate_directive(ast_directive, directive_names, context)
1616
if !directive_names.include?(ast_directive.name)
1717
context.errors << message("Directive @#{ast_directive.name} is not defined", ast_directive, context: context)
18+
GraphQL::Language::Visitor::SKIP
19+
else
20+
nil
1821
end
1922
end
2023
end

0 commit comments

Comments
 (0)