diff --git a/lib/graphql/schema/argument.rb b/lib/graphql/schema/argument.rb index 9cdb026d57..633f329b65 100644 --- a/lib/graphql/schema/argument.rb +++ b/lib/graphql/schema/argument.rb @@ -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}."