Class: GraphQL::Query::Arguments
- Inherits:
-
Object
- Object
- GraphQL::Query::Arguments
- Defined in:
- lib/graph_ql/query/arguments.rb
Overview
Creates a plain hash out of arguments, looking up variables if necessary
Instance Attribute Summary collapse
-
#to_h ⇒ Object
readonly
Returns the value of attribute to_h.
Instance Method Summary collapse
-
#initialize(ast_arguments, variables) ⇒ Arguments
constructor
A new instance of Arguments.
Constructor Details
#initialize(ast_arguments, variables) ⇒ Arguments
Returns a new instance of Arguments.
4 5 6 7 8 9 10 |
# File 'lib/graph_ql/query/arguments.rb', line 4 def initialize(ast_arguments, variables) @to_h = ast_arguments.reduce({}) do |memo, arg| value = reduce_value(arg.value, variables) memo[arg.name] = value memo end end |
Instance Attribute Details
#to_h ⇒ Object (readonly)
Returns the value of attribute to_h.
3 4 5 |
# File 'lib/graph_ql/query/arguments.rb', line 3 def to_h @to_h end |