Class: GraphQL::Extras::Types::Date

Inherits:
Schema::Scalar
  • Object
show all
Defined in:
lib/graphql/extras/types.rb

Class Method Summary collapse

Class Method Details

.coerce_input(value, _context) ⇒ Object



23
24
25
26
27
# File 'lib/graphql/extras/types.rb', line 23

def self.coerce_input(value, _context)
  ::Date.iso8601(value)
rescue ArgumentError
  nil
end

.coerce_result(value, _context) ⇒ Object



29
30
31
# File 'lib/graphql/extras/types.rb', line 29

def self.coerce_result(value, _context)
  value.iso8601
end