projects/cloud/app/controllers/graphql_controller.rb
# Handle variables in form data, JSON body, or a blank value
Handle variables in form data, JSON body, or a blank value
Handle variables in form data JSON body or a blank value
def prepare_variables(variables_param)
      case variables_param
      when String
        if variables_param.present?
          JSON.parse(variables_param) || {}
        else
          {}
        end
      when Hash
        variables_param
      when ActionController::Parameters
        variables_param.to_unsafe_hash 
      when nil
        {}
      else
        raise ArgumentError, "Unexpected parameter: #{variables_param}"
      end
    end
def prepare_variables ( variables_param ) case variables_param when String if variables_param . present? JSON . parse ( variables_param ) || { } else { } end when Hash variables_param when ActionController :: Parameters variables_param . to_unsafe_hash when nil { } else raise ArgumentError , "Unexpected parameter: #{variables_param}" end end
Handle variables in form data, JSON body, or a blank value
Handle variables in form data JSON body or a blank value
# GraphQL-Ruby will validate name and type of incoming variables.
variables_param
<not_specific>