Skip to content

Commit 41ab9b4

Browse files
author
Hoa Nguyen
committed
chore: enhance conditional
1 parent 16e4c22 commit 41ab9b4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/graphql/static_validation/validator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def validate(query, validate: true)
3434

3535
# Attach legacy-style rules.
3636
# Only loop through rules if it has legacy-style rules
37-
if legacy_rules = rules_to_use - GraphQL::StaticValidation::ALL_RULES
37+
unless (legacy_rules = rules_to_use - GraphQL::StaticValidation::ALL_RULES).empty?
3838
legacy_rules.each do |rule_class_or_module|
3939
if rule_class_or_module.method_defined?(:validate)
4040
rule_class_or_module.new.validate(context)

0 commit comments

Comments
 (0)