lib/rails/graphql/request/steps/organizable.rb
# Helper parser for request arguments (operation variables) that
# collect necessary arguments from the request
Helper parser for request arguments (operation variables) that
collect necessary arguments from the request
Helper parser for request arguments ( operation variables ) that collect necessary arguments from the request
def parse_variables
            @arguments = {}
            visitor.collect_variables(*data[:variables]) do |data, node|
              arg_name = data[:name]
              raise ExecutionError, <<~MSG.squish if arguments.key?(arg_name)
                The "#{arg_name}" argument is already defined for this #{kind}.
              MSG
              extra = data.to_h.except(:name, :type).merge(owner: schema)
              item = arguments[arg_name] = Argument.new(arg_name, data[:type], **extra)
              item.node = node
              item.validate!
            end unless data[:variables].blank?
            args = request.sanitized_arguments
            args = collect_arguments(self, args, var_access: false) do |errors|
              "Invalid arguments for #{log_source}: #{errors}."
            end
            @variables = args.freeze
            @arguments.freeze
          end
def parse_variables @arguments = { } visitor . collect_variables ( * data [ :variables ] ) do | data , node | arg_name = data [ :name ] raise ExecutionError , <<~MSG . squish if arguments . key? ( arg_name ) 
                The " #{ arg_name } " argument is already defined for this  #{ kind } .
               MSG extra = data . to_h . except ( :name , :type ) . merge ( owner : schema ) item = arguments [ arg_name ] = Argument . new ( arg_name , data [ :type ] , ** extra ) item . node = node item . validate! end unless data [ :variables ] . blank? args = request . sanitized_arguments args = collect_arguments ( self , args , var_access : false ) do | errors | "Invalid arguments for #{log_source}: #{errors}." end @variables = args . freeze @arguments . freeze end
Helper parser for request arguments (operation variables) that
collect necessary arguments from the request
Helper parser for request arguments ( operation variables ) that collect necessary arguments from the request