Skip to content

Commit

Permalink
Restore original order of prepare call method
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Edey committed Dec 4, 2023
1 parent 3f25272 commit 7e4f5b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/graphql/schema/argument.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ def prepare_value(obj, value, context: nil)
#
# This will have to be called later, when the runtime object _is_ available.
value
elsif owner.respond_to?(@prepare)
owner.public_send(@prepare, value, context || obj.context)
elsif obj.respond_to?(@prepare)
obj.public_send(@prepare, value)
elsif owner.respond_to?(@prepare)
owner.public_send(@prepare, value, context || obj.context)
else
raise "Invalid prepare for #{@owner.name}.name: #{@prepare.inspect}. "\
"Could not find prepare method #{@prepare} on #{obj.class} or #{owner}."
Expand Down

0 comments on commit 7e4f5b4

Please sign in to comment.