Skip to content

Commit

Permalink
Use import_methods instead of include in refinements if available.
Browse files Browse the repository at this point in the history
  • Loading branch information
a-lavis committed Mar 23, 2024
1 parent 5c38607 commit 8378e1f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/graphql/deprecated_dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,17 @@ def !
end
end

TYPE_CLASSES.each do |type_class|
refine type_class.singleton_class do
include Methods
if defined?(::Refinement) && Refinement.private_method_defined?(:import_methods)
TYPE_CLASSES.each do |type_class|
refine type_class.singleton_class do
import_methods Methods
end
end
else
TYPE_CLASSES.each do |type_class|
refine type_class.singleton_class do
include Methods
end
end
end
end
Expand Down

0 comments on commit 8378e1f

Please sign in to comment.