Class: GraphQL::Client::QueryResult::Scalar

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/client/query_result.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Scalar

Returns a new instance of Scalar.



51
52
53
# File 'lib/graphql/client/query_result.rb', line 51

def initialize(type)
  @type = type
end

Instance Method Details

#cast(value, _errors = nil) ⇒ Object



55
56
57
# File 'lib/graphql/client/query_result.rb', line 55

def cast(value, _errors = nil)
  @type.coerce_input(value)
end

#|(_other) ⇒ Object



59
60
61
62
# File 'lib/graphql/client/query_result.rb', line 59

def |(_other)
  # XXX: How would scalars merge?
  self
end