Module: GraphQL::Query::LiteralInput::LiteralKindCoercers::ListLiteral

Defined in:
lib/graphql/query/literal_input.rb

Class Method Summary collapse

Class Method Details

.coerce(value, type, variables) ⇒ Object


50
51
52
53
54
55
56
# File 'lib/graphql/query/literal_input.rb', line 50

def self.coerce(value, type, variables)
  if value.is_a?(Array)
    value.map{ |element_ast| LiteralInput.coerce(type.of_type, element_ast, variables) }
  else
    [LiteralInput.coerce(type.of_type, value, variables)]
  end
end