60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/graphql/query/literal_input.rb', line 60
def self.coerce(value, type, variables)
hash = {}
value.arguments.each do |arg|
field_type = type.input_fields[arg.name].type
hash[arg.name] = LiteralInput.coerce(field_type, arg.value, variables)
end
type.input_fields.each do |arg_name, arg_defn|
if hash[arg_name].nil?
value = LiteralInput.coerce(arg_defn.type, arg_defn.default_value, variables)
if !value.nil?
hash[arg_name] = value
end
end
end
Arguments.new(hash)
end
|