Class: ElasticGraph::GraphQL::ScalarCoercionAdapters::LocalTime

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_graph/graphql/scalar_coercion_adapters/local_time.rb

Class Method Summary collapse

Class Method Details

.coerce_input(value, ctx) ⇒ Object



15
16
17
18
# File 'lib/elastic_graph/graphql/scalar_coercion_adapters/local_time.rb', line 15

def self.coerce_input(value, ctx)
  validated_value(value) || raise(::GraphQL::CoercionError,
    "Could not coerce value #{value.inspect} to LocalTime: must be formatted as an RFC3339 partial time (such as `14:23:12` or `07:05:23.555`")
end

.coerce_result(value, ctx) ⇒ Object



20
21
22
# File 'lib/elastic_graph/graphql/scalar_coercion_adapters/local_time.rb', line 20

def self.coerce_result(value, ctx)
  validated_value(value)
end